q5 2.10.7 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/deno.json +36 -0
- package/package.json +3 -6
- package/q5-deno-server.js +45 -0
- package/q5-server.js +6 -7
- package/q5.js +19 -13
- package/q5.min.js +2 -2
- package/src/q5-2d-image.js +1 -1
- package/src/q5-canvas.js +16 -10
- package/src/q5-core.js +2 -2
- package/test/core.test.js +30 -0
- package/test/readme.md +5 -0
- package/.vscode/launch.json +0 -26
- package/.vscode/settings.json +0 -3
- package/bun.lockb +0 -0
- package/p5-tests/js/chai_helpers.js +0 -20
- package/p5-tests/js/mocha_setup.js +0 -2
- package/p5-tests/js/modernizr.js +0 -5
- package/p5-tests/js/p5_helpers.js +0 -135
- package/p5-tests/js/sinon.js +0 -5949
- package/p5-tests/mocha.css +0 -289
- package/p5-tests/test.html +0 -71
- package/p5-tests/unit/color/color_conversion.js +0 -68
- package/p5-tests/unit/color/creating_reading.js +0 -217
- package/p5-tests/unit/color/p5.Color.js +0 -1000
- package/p5-tests/unit/color/setting.js +0 -289
- package/p5-tests/unit/core/2d_primitives.js +0 -490
- package/p5-tests/unit/core/attributes.js +0 -115
- package/p5-tests/unit/core/curves.js +0 -139
- package/p5-tests/unit/core/environment.js +0 -248
- package/p5-tests/unit/core/error_helpers.js +0 -1158
- package/p5-tests/unit/core/main.js +0 -340
- package/p5-tests/unit/core/p5.Element.js +0 -773
- package/p5-tests/unit/core/p5.Graphics.js +0 -179
- package/p5-tests/unit/core/preload.js +0 -285
- package/p5-tests/unit/core/rendering.js +0 -116
- package/p5-tests/unit/core/structure.js +0 -293
- package/p5-tests/unit/core/transform.js +0 -144
- package/p5-tests/unit/core/version.js +0 -28
- package/p5-tests/unit/core/vertex.js +0 -137
- package/p5-tests/unit/dom/dom.js +0 -2146
- package/p5-tests/unit/events/acceleration.js +0 -213
- package/p5-tests/unit/events/keyboard.js +0 -179
- package/p5-tests/unit/events/mouse.js +0 -487
- package/p5-tests/unit/events/touch.js +0 -180
- package/p5-tests/unit/image/downloading.js +0 -379
- package/p5-tests/unit/image/filters.js +0 -92
- package/p5-tests/unit/image/loading.js +0 -413
- package/p5-tests/unit/image/p5.Image.js +0 -201
- package/p5-tests/unit/image/pixels.js +0 -234
- package/p5-tests/unit/io/files.js +0 -378
- package/p5-tests/unit/io/loadBytes.js +0 -149
- package/p5-tests/unit/io/loadImage.js +0 -123
- package/p5-tests/unit/io/loadJSON.js +0 -185
- package/p5-tests/unit/io/loadModel.js +0 -215
- package/p5-tests/unit/io/loadShader.js +0 -176
- package/p5-tests/unit/io/loadStrings.js +0 -140
- package/p5-tests/unit/io/loadTable.js +0 -183
- package/p5-tests/unit/io/loadXML.js +0 -127
- package/p5-tests/unit/io/saveModel.js +0 -113
- package/p5-tests/unit/io/saveTable.js +0 -142
- package/p5-tests/unit/math/calculation.js +0 -452
- package/p5-tests/unit/math/noise.js +0 -66
- package/p5-tests/unit/math/p5.Vector.js +0 -1886
- package/p5-tests/unit/math/random.js +0 -177
- package/p5-tests/unit/math/trigonometry.js +0 -144
- package/p5-tests/unit/spec.js +0 -50
- package/p5-tests/unit/typography/attributes.js +0 -120
- package/p5-tests/unit/typography/loadFont.js +0 -162
- package/p5-tests/unit/typography/p5.Font.js +0 -63
- package/p5-tests/unit/utilities/conversion.js +0 -329
- package/p5-tests/unit/utilities/time_date.js +0 -133
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
suite('Noise', function() {
|
|
2
|
-
var myp5;
|
|
3
|
-
|
|
4
|
-
setup(function(done) {
|
|
5
|
-
new p5(function(p) {
|
|
6
|
-
p.setup = function() {
|
|
7
|
-
myp5 = p;
|
|
8
|
-
done();
|
|
9
|
-
};
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
teardown(function() {
|
|
14
|
-
myp5.remove();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// This could use some better testing!
|
|
18
|
-
// Just checking that we get an actual number now
|
|
19
|
-
// 1D noise only
|
|
20
|
-
// ALso need test for noiseSeed and noiseDetail
|
|
21
|
-
var result;
|
|
22
|
-
var results = [];
|
|
23
|
-
|
|
24
|
-
suite('p5.prototype.noise', function() {
|
|
25
|
-
setup(function() {
|
|
26
|
-
result = myp5.noise(0);
|
|
27
|
-
});
|
|
28
|
-
test('should return a number', function() {
|
|
29
|
-
assert.typeOf(result, 'number');
|
|
30
|
-
});
|
|
31
|
-
test('should return a number 0 < n < 1', function() {
|
|
32
|
-
assert.isTrue(result > 0);
|
|
33
|
-
assert.isTrue(result < 1);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// Test for noiseSeed
|
|
38
|
-
suite('p5.prototype.noiseSeed', function() {
|
|
39
|
-
setup(function() {
|
|
40
|
-
myp5.noiseSeed(99);
|
|
41
|
-
var t = 0;
|
|
42
|
-
for (var i = 0; i < 5; i++) {
|
|
43
|
-
results[i] = myp5.noise(t);
|
|
44
|
-
t += 0.01;
|
|
45
|
-
}
|
|
46
|
-
myp5.noiseSeed(99);
|
|
47
|
-
t = 0;
|
|
48
|
-
for (i = 5; i < 10; i++) {
|
|
49
|
-
results[i] = myp5.noise(t);
|
|
50
|
-
t += 0.01;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
test('should return a number 0 < n < 1', function() {
|
|
54
|
-
for (var i = 0; i < results.length; i++) {
|
|
55
|
-
assert.typeOf(results[i], 'number');
|
|
56
|
-
assert.isTrue(results[i] > 0);
|
|
57
|
-
assert.isTrue(results[i] < 1);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
test('should return same sequence of numbers', function() {
|
|
61
|
-
for (var i = 0; i < 5; i++) {
|
|
62
|
-
assert.isTrue(results[i] === results[i + 5]);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|