Browse Source

correct fmod implementation

Inderjit Gill 1 month ago
parent
commit
c1147d89f5
6 changed files with 323 additions and 306 deletions
  1. 27
    2
      core/src/colour.rs
  2. 200
    200
      core/src/colour_palettes.rs
  3. 0
    8
      core/src/compiler.rs
  4. 58
    58
      core/src/lib.rs
  5. 29
    29
      core/src/native.rs
  6. 9
    9
      core/src/trait_list.rs

+ 27
- 2
core/src/colour.rs View File

@@ -689,9 +689,8 @@ fn max_channel(r: f64, g: f64, b: f64) -> i32 {
689 689
     }
690 690
 }
691 691
 
692
-// TODO: implement a better fmod, this one is not exact
693 692
 fn fmod(a: f64, b: f64) -> f64 {
694
-    a - b * (a / b).floor()
693
+    a - b * (a / b).trunc()
695 694
 }
696 695
 
697 696
 // http://www.rapidtables.com/convert/color/rgb-to-hsl.htm
@@ -1299,4 +1298,30 @@ mod tests {
1299 1298
         assert_hex_colour("ff00ff", ColourFormat::Rgb, 1.0, 0.0, 1.0, 1.0);
1300 1299
     }
1301 1300
 
1301
+    fn assert_equal_f64(a: f64, b: f64) {
1302
+        let diff = (a - b).abs();
1303
+        let delta: f64 = 0.0001;
1304
+
1305
+        assert!(diff < delta, "a = {}, b = {}", a, b);
1306
+    }
1307
+
1308
+    #[test]
1309
+    fn test_fmod() {
1310
+        assert_equal_f64(3.0, fmod(3.0, 10.0));
1311
+        assert_equal_f64(1.0, fmod(10.0, 3.0));
1312
+
1313
+        assert_equal_f64(45.0, fmod(45.0, 360.0));
1314
+        assert_equal_f64(0.0, fmod(360.0, 360.0));
1315
+        assert_equal_f64(1.0, fmod(361.0, 360.0));
1316
+        assert_equal_f64(359.9, fmod(359.9, 360.0));
1317
+
1318
+        assert_equal_f64(0.0, fmod(0.0, 6.0));
1319
+        assert_equal_f64(-0.5, fmod(-0.5, 6.0));
1320
+        assert_equal_f64(-2.0, fmod(-2.0, 6.0));
1321
+        assert_equal_f64(-5.9, fmod(-5.9, 6.0));
1322
+        assert_equal_f64(0.0, fmod(-6.0, 6.0));
1323
+        assert_equal_f64(-0.1, fmod(-6.1, 6.0));
1324
+        assert_equal_f64(-1.0, fmod(-7.0, 6.0));
1325
+    }
1326
+
1302 1327
 }

+ 200
- 200
core/src/colour_palettes.rs View File

@@ -16,204 +16,204 @@
16 16
 // top colour palettes from http://colourlovers.com/
17 17
 //
18 18
 pub const COLOUR_PALETTES: &[&[&'static str]] = &[
19
-    &["69d2e7","a7dbd8","e0e4cc","f38630","fa6900"],
20
-    &["fe4365","fc9d9a","f9cdad","c8c8a9","83af9b"],
21
-    &["ecd078","d95b43","c02942","542437","53777a"],
22
-    &["556270","4ecdc4","c7f464","ff6b6b","c44d58"],
23
-    &["774f38","e08e79","f1d4af","ece5ce","c5e0dc"],
24
-    &["e8ddcb","cdb380","036564","033649","031634"],
25
-    &["490a3d","bd1550","e97f02","f8ca00","8a9b0f"],
26
-    &["594f4f","547980","45ada8","9de0ad","e5fcc2"],
27
-    &["00a0b0","6a4a3c","cc333f","eb6841","edc951"],
28
-    &["e94e77","d68189","c6a49a","c6e5d9","f4ead5"],
29
-    &["3fb8af","7fc7af","dad8a7","ff9e9d","ff3d7f"],
30
-    &["d9ceb2","948c75","d5ded9","7a6a53","99b2b7"],
31
-    &["ffffff","cbe86b","f2e9e1","1c140d","cbe86b"],
32
-    &["efffcd","dce9be","555152","2e2633","99173c"],
33
-    &["343838","005f6b","008c9e","00b4cc","00dffc"],
34
-    &["413e4a","73626e","b38184","f0b49e","f7e4be"],
35
-    &["ff4e50","fc913a","f9d423","ede574","e1f5c4"],
36
-    &["99b898","fecea8","ff847c","e84a5f","2a363b"],
37
-    &["655643","80bca3","f6f7bd","e6ac27","bf4d28"],
38
-    &["00a8c6","40c0cb","f9f2e7","aee239","8fbe00"],
39
-    &["351330","424254","64908a","e8caa4","cc2a41"],
40
-    &["554236","f77825","d3ce3d","f1efa5","60b99a"],
41
-    &["5d4157","838689","a8caba","cad7b2","ebe3aa"],
42
-    &["8c2318","5e8c6a","88a65e","bfb35a","f2c45a"],
43
-    &["fad089","ff9c5b","f5634a","ed303c","3b8183"],
44
-    &["ff4242","f4fad2","d4ee5e","e1edb9","f0f2eb"],
45
-    &["f8b195","f67280","c06c84","6c5b7b","355c7d"],
46
-    &["d1e751","ffffff","000000","4dbce9","26ade4"],
47
-    &["1b676b","519548","88c425","bef202","eafde6"],
48
-    &["5e412f","fcebb6","78c0a8","f07818","f0a830"],
49
-    &["bcbdac","cfbe27","f27435","f02475","3b2d38"],
50
-    &["452632","91204d","e4844a","e8bf56","e2f7ce"],
51
-    &["eee6ab","c5bc8e","696758","45484b","36393b"],
52
-    &["f0d8a8","3d1c00","86b8b1","f2d694","fa2a00"],
53
-    &["2a044a","0b2e59","0d6759","7ab317","a0c55f"],
54
-    &["f04155","ff823a","f2f26f","fff7bd","95cfb7"],
55
-    &["b9d7d9","668284","2a2829","493736","7b3b3b"],
56
-    &["bbbb88","ccc68d","eedd99","eec290","eeaa88"],
57
-    &["b3cc57","ecf081","ffbe40","ef746f","ab3e5b"],
58
-    &["a3a948","edb92e","f85931","ce1836","009989"],
59
-    &["300030","480048","601848","c04848","f07241"],
60
-    &["67917a","170409","b8af03","ccbf82","e33258"],
61
-    &["aab3ab","c4cbb7","ebefc9","eee0b7","e8caaf"],
62
-    &["e8d5b7","0e2430","fc3a51","f5b349","e8d5b9"],
63
-    &["ab526b","bca297","c5ceae","f0e2a4","f4ebc3"],
64
-    &["607848","789048","c0d860","f0f0d8","604848"],
65
-    &["b6d8c0","c8d9bf","dadabd","ecdbbc","fedcba"],
66
-    &["a8e6ce","dcedc2","ffd3b5","ffaaa6","ff8c94"],
67
-    &["3e4147","fffedf","dfba69","5a2e2e","2a2c31"],
68
-    &["fc354c","29221f","13747d","0abfbc","fcf7c5"],
69
-    &["cc0c39","e6781e","c8cf02","f8fcc1","1693a7"],
70
-    &["1c2130","028f76","b3e099","ffeaad","d14334"],
71
-    &["a7c5bd","e5ddcb","eb7b59","cf4647","524656"],
72
-    &["dad6ca","1bb0ce","4f8699","6a5e72","563444"],
73
-    &["5c323e","a82743","e15e32","c0d23e","e5f04c"],
74
-    &["edebe6","d6e1c7","94c7b6","403b33","d3643b"],
75
-    &["fdf1cc","c6d6b8","987f69","e3ad40","fcd036"],
76
-    &["230f2b","f21d41","ebebbc","bce3c5","82b3ae"],
77
-    &["b9d3b0","81bda4","b28774","f88f79","f6aa93"],
78
-    &["3a111c","574951","83988e","bcdea5","e6f9bc"],
79
-    &["5e3929","cd8c52","b7d1a3","dee8be","fcf7d3"],
80
-    &["1c0113","6b0103","a30006","c21a01","f03c02"],
81
-    &["000000","9f111b","b11623","292c37","cccccc"],
82
-    &["382f32","ffeaf2","fcd9e5","fbc5d8","f1396d"],
83
-    &["e3dfba","c8d6bf","93ccc6","6cbdb5","1a1f1e"],
84
-    &["f6f6f6","e8e8e8","333333","990100","b90504"],
85
-    &["1b325f","9cc4e4","e9f2f9","3a89c9","f26c4f"],
86
-    &["a1dbb2","fee5ad","faca66","f7a541","f45d4c"],
87
-    &["c1b398","605951","fbeec2","61a6ab","accec0"],
88
-    &["5e9fa3","dcd1b4","fab87f","f87e7b","b05574"],
89
-    &["951f2b","f5f4d7","e0dfb1","a5a36c","535233"],
90
-    &["8dccad","988864","fea6a2","f9d6ac","ffe9af"],
91
-    &["2d2d29","215a6d","3ca2a2","92c7a3","dfece6"],
92
-    &["413d3d","040004","c8ff00","fa023c","4b000f"],
93
-    &["eff3cd","b2d5ba","61ada0","248f8d","605063"],
94
-    &["ffefd3","fffee4","d0ecea","9fd6d2","8b7a5e"],
95
-    &["cfffdd","b4dec1","5c5863","a85163","ff1f4c"],
96
-    &["9dc9ac","fffec7","f56218","ff9d2e","919167"],
97
-    &["4e395d","827085","8ebe94","ccfc8e","dc5b3e"],
98
-    &["a8a7a7","cc527a","e8175d","474747","363636"],
99
-    &["f8edd1","d88a8a","474843","9d9d93","c5cfc6"],
100
-    &["046d8b","309292","2fb8ac","93a42a","ecbe13"],
101
-    &["f38a8a","55443d","a0cab5","cde9ca","f1edd0"],
102
-    &["a70267","f10c49","fb6b41","f6d86b","339194"],
103
-    &["ff003c","ff8a00","fabe28","88c100","00c176"],
104
-    &["ffedbf","f7803c","f54828","2e0d23","f8e4c1"],
105
-    &["4e4d4a","353432","94ba65","2790b0","2b4e72"],
106
-    &["0ca5b0","4e3f30","fefeeb","f8f4e4","a5b3aa"],
107
-    &["4d3b3b","de6262","ffb88c","ffd0b3","f5e0d3"],
108
-    &["fffbb7","a6f6af","66b6ab","5b7c8d","4f2958"],
109
-    &["edf6ee","d1c089","b3204d","412e28","151101"],
110
-    &["9d7e79","ccac95","9a947c","748b83","5b756c"],
111
-    &["fcfef5","e9ffe1","cdcfb7","d6e6c3","fafbe3"],
112
-    &["9cddc8","bfd8ad","ddd9ab","f7af63","633d2e"],
113
-    &["30261c","403831","36544f","1f5f61","0b8185"],
114
-    &["aaff00","ffaa00","ff00aa","aa00ff","00aaff"],
115
-    &["d1313d","e5625c","f9bf76","8eb2c5","615375"],
116
-    &["ffe181","eee9e5","fad3b2","ffba7f","ff9c97"],
117
-    &["73c8a9","dee1b6","e1b866","bd5532","373b44"],
118
-    &["805841","dcf7f3","fffcdd","ffd8d8","f5a2a2"],
119
-    &["379f7a","78ae62","bbb749","e0fbac","1f1c0d"],
120
-    &["caff42","ebf7f8","d0e0eb","88abc2","49708a"],
121
-    &["c2412d","d1aa34","a7a844","a46583","5a1e4a"],
122
-    &["75616b","bfcff7","dce4f7","f8f3bf","d34017"],
123
-    &["111625","341931","571b3c","7a1e48","9d2053"],
124
-    &["82837e","94b053","bdeb07","bffa37","e0e0e0"],
125
-    &["7e5686","a5aad9","e8f9a2","f8a13f","ba3c3d"],
126
-    &["312736","d4838f","d6abb1","d9d9d9","c4ffeb"],
127
-    &["395a4f","432330","853c43","f25c5e","ffa566"],
128
-    &["fde6bd","a1c5ab","f4dd51","d11e48","632f53"],
129
-    &["84b295","eccf8d","bb8138","ac2005","2c1507"],
130
-    &["058789","503d2e","d54b1a","e3a72f","f0ecc9"],
131
-    &["6da67a","77b885","86c28b","859987","4a4857"],
132
-    &["bed6c7","adc0b4","8a7e66","a79b83","bbb2a1"],
133
-    &["261c21","6e1e62","b0254f","de4126","eb9605"],
134
-    &["efd9b4","d6a692","a39081","4d6160","292522"],
135
-    &["e21b5a","9e0c39","333333","fbffe3","83a300"],
136
-    &["f2e3c6","ffc6a5","e6324b","2b2b2b","353634"],
137
-    &["c75233","c78933","d6ceaa","79b5ac","5e2f46"],
138
-    &["793a57","4d3339","8c873e","d1c5a5","a38a5f"],
139
-    &["512b52","635274","7bb0a8","a7dbab","e4f5b1"],
140
-    &["11644d","a0b046","f2c94e","f78145","f24e4e"],
141
-    &["59b390","f0ddaa","e47c5d","e32d40","152b3c"],
142
-    &["fdffd9","fff0b8","ffd6a3","faad8e","142f30"],
143
-    &["b5ac01","ecba09","e86e1c","d41e45","1b1521"],
144
-    &["c7fcd7","d9d5a7","d9ab91","e6867a","ed4a6a"],
145
-    &["11766d","410936","a40b54","e46f0a","f0b300"],
146
-    &["595643","4e6b66","ed834e","ebcc6e","ebe1c5"],
147
-    &["f1396d","fd6081","f3ffeb","acc95f","8f9924"],
148
-    &["331327","991766","d90f5a","f34739","ff6e27"],
149
-    &["efeecc","fe8b05","fe0557","400403","0aabba"],
150
-    &["bf496a","b39c82","b8c99d","f0d399","595151"],
151
-    &["b7cbbf","8c886f","f9a799","f4bfad","f5dabd"],
152
-    &["ffb884","f5df98","fff8d4","c0d1c2","2e4347"],
153
-    &["e5eaa4","a8c4a2","69a5a4","616382","66245b"],
154
-    &["e0eff1","7db4b5","ffffff","680148","000000"],
155
-    &["b1e6d1","77b1a9","3d7b80","270a33","451a3e"],
156
-    &["e4ded0","abccbd","7dbeb8","181619","e32f21"],
157
-    &["e9e0d1","91a398","33605a","070001","68462b"],
158
-    &["fc284f","ff824a","fea887","f6e7f7","d1d0d7"],
159
-    &["ffab07","e9d558","72ad75","0e8d94","434d53"],
160
-    &["6da67a","99a66d","a9bd68","b5cc6a","c0de5d"],
161
-    &["311d39","67434f","9b8e7e","c3ccaf","a51a41"],
162
-    &["cfb590","9e9a41","758918","564334","49281f"],
163
-    &["5cacc4","8cd19d","cee879","fcb653","ff5254"],
164
-    &["44749d","c6d4e1","ffffff","ebe7e0","bdb8ad"],
165
-    &["807462","a69785","b8faff","e8fdff","665c49"],
166
-    &["e7edea","ffc52c","fb0c06","030d4f","ceecef"],
167
-    &["ccf390","e0e05a","f7c41f","fc930a","ff003d"],
168
-    &["2b222c","5e4352","965d62","c7956d","f2d974"],
169
-    &["cc5d4c","fffec6","c7d1af","96b49c","5b5847"],
170
-    &["e4e4c5","b9d48b","8d2036","ce0a31","d3e4c5"],
171
-    &["e3e8cd","bcd8bf","d3b9a3","ee9c92","fe857e"],
172
-    &["360745","d61c59","e7d84b","efeac5","1b8798"],
173
-    &["ec4401","cc9b25","13cd4a","7b6ed6","5e525c"],
174
-    &["eb9c4d","f2d680","f3ffcf","bac9a9","697060"],
175
-    &["f2e8c4","98d9b6","3ec9a7","2b879e","616668"],
176
-    &["f5dd9d","bcc499","92a68a","7b8f8a","506266"],
177
-    &["fff3db","e7e4d5","d3c8b4","c84648","703e3b"],
178
-    &["041122","259073","7fda89","c8e98e","e6f99d"],
179
-    &["8d7966","a8a39d","d8c8b8","e2ddd9","f8f1e9"],
180
-    &["c6cca5","8ab8a8","6b9997","54787d","615145"],
181
-    &["1d1313","24b694","d22042","a3b808","30c4c9"],
182
-    &["4b1139","3b4058","2a6e78","7a907c","c9b180"],
183
-    &["2d1b33","f36a71","ee887a","e4e391","9abc8a"],
184
-    &["f0ffc9","a9da88","62997a","72243d","3b0819"],
185
-    &["429398","6b5d4d","b0a18f","dfcdb4","fbeed3"],
186
-    &["9d9e94","c99e93","f59d92","e5b8ad","d5d2c8"],
187
-    &["95a131","c8cd3b","f6f1de","f5b9ae","ee0b5b"],
188
-    &["322938","89a194","cfc89a","cc883a","a14016"],
189
-    &["540045","c60052","ff714b","eaff87","acffe9"],
190
-    &["79254a","795c64","79927d","aeb18e","e3cf9e"],
191
-    &["452e3c","ff3d5a","ffb969","eaf27e","3b8c88"],
192
-    &["2b2726","0a516d","018790","7dad93","bacca4"],
193
-    &["027b7f","ffa588","d62957","bf1e62","572e4f"],
194
-    &["fa6a64","7a4e48","4a4031","f6e2bb","9ec6b8"],
195
-    &["fb6900","f63700","004853","007e80","00b9bd"],
196
-    &["f06d61","da825f","c4975c","a8ab7b","8cbf99"],
197
-    &["23192d","fd0a54","f57576","febf97","f5ecb7"],
198
-    &["f6d76b","ff9036","d6254d","ff5475","fdeba9"],
199
-    &["a3c68c","879676","6e6662","4f364a","340735"],
200
-    &["a32c28","1c090b","384030","7b8055","bca875"],
201
-    &["80a8a8","909d9e","a88c8c","ff0d51","7a8c89"],
202
-    &["6d9788","1e2528","7e1c13","bf0a0d","e6e1c2"],
203
-    &["373737","8db986","acce91","badb73","efeae4"],
204
-    &["e6b39a","e6cba5","ede3b4","8b9e9b","6d7578"],
205
-    &["280904","680e34","9a151a","c21b12","fc4b2a"],
206
-    &["4b3e4d","1e8c93","dbd8a2","c4ac30","d74f33"],
207
-    &["161616","c94d65","e7c049","92b35a","1f6764"],
208
-    &["234d20","36802d","77ab59","c9df8a","f0f7da"],
209
-    &["a69e80","e0ba9b","e7a97e","d28574","3b1922"],
210
-    &["641f5e","676077","65ac92","c2c092","edd48e"],
211
-    &["e6eba9","abbb9f","6f8b94","706482","703d6f"],
212
-    &["26251c","eb0a44","f2643d","f2a73d","a0e8b7"],
213
-    &["fdcfbf","feb89f","e23d75","5f0d3b","742365"],
214
-    &["ff7474","f59b71","c7c77f","e0e0a8","f1f1c1"],
215
-    &["4f364c","5e405f","6b6b6b","8f9e6f","b1cf72"],
216
-    &["230b00","a29d7f","d4cfa5","f8ecd4","aabe9b"],
217
-    &["d4f7dc","dbe7b4","dbc092","e0846d","f51441"],
218
-    &["62a07b","4f8b89","536c8d","5c4f79","613860"],
19
+    &["69d2e7", "a7dbd8", "e0e4cc", "f38630", "fa6900"],
20
+    &["fe4365", "fc9d9a", "f9cdad", "c8c8a9", "83af9b"],
21
+    &["ecd078", "d95b43", "c02942", "542437", "53777a"],
22
+    &["556270", "4ecdc4", "c7f464", "ff6b6b", "c44d58"],
23
+    &["774f38", "e08e79", "f1d4af", "ece5ce", "c5e0dc"],
24
+    &["e8ddcb", "cdb380", "036564", "033649", "031634"],
25
+    &["490a3d", "bd1550", "e97f02", "f8ca00", "8a9b0f"],
26
+    &["594f4f", "547980", "45ada8", "9de0ad", "e5fcc2"],
27
+    &["00a0b0", "6a4a3c", "cc333f", "eb6841", "edc951"],
28
+    &["e94e77", "d68189", "c6a49a", "c6e5d9", "f4ead5"],
29
+    &["3fb8af", "7fc7af", "dad8a7", "ff9e9d", "ff3d7f"],
30
+    &["d9ceb2", "948c75", "d5ded9", "7a6a53", "99b2b7"],
31
+    &["ffffff", "cbe86b", "f2e9e1", "1c140d", "cbe86b"],
32
+    &["efffcd", "dce9be", "555152", "2e2633", "99173c"],
33
+    &["343838", "005f6b", "008c9e", "00b4cc", "00dffc"],
34
+    &["413e4a", "73626e", "b38184", "f0b49e", "f7e4be"],
35
+    &["ff4e50", "fc913a", "f9d423", "ede574", "e1f5c4"],
36
+    &["99b898", "fecea8", "ff847c", "e84a5f", "2a363b"],
37
+    &["655643", "80bca3", "f6f7bd", "e6ac27", "bf4d28"],
38
+    &["00a8c6", "40c0cb", "f9f2e7", "aee239", "8fbe00"],
39
+    &["351330", "424254", "64908a", "e8caa4", "cc2a41"],
40
+    &["554236", "f77825", "d3ce3d", "f1efa5", "60b99a"],
41
+    &["5d4157", "838689", "a8caba", "cad7b2", "ebe3aa"],
42
+    &["8c2318", "5e8c6a", "88a65e", "bfb35a", "f2c45a"],
43
+    &["fad089", "ff9c5b", "f5634a", "ed303c", "3b8183"],
44
+    &["ff4242", "f4fad2", "d4ee5e", "e1edb9", "f0f2eb"],
45
+    &["f8b195", "f67280", "c06c84", "6c5b7b", "355c7d"],
46
+    &["d1e751", "ffffff", "000000", "4dbce9", "26ade4"],
47
+    &["1b676b", "519548", "88c425", "bef202", "eafde6"],
48
+    &["5e412f", "fcebb6", "78c0a8", "f07818", "f0a830"],
49
+    &["bcbdac", "cfbe27", "f27435", "f02475", "3b2d38"],
50
+    &["452632", "91204d", "e4844a", "e8bf56", "e2f7ce"],
51
+    &["eee6ab", "c5bc8e", "696758", "45484b", "36393b"],
52
+    &["f0d8a8", "3d1c00", "86b8b1", "f2d694", "fa2a00"],
53
+    &["2a044a", "0b2e59", "0d6759", "7ab317", "a0c55f"],
54
+    &["f04155", "ff823a", "f2f26f", "fff7bd", "95cfb7"],
55
+    &["b9d7d9", "668284", "2a2829", "493736", "7b3b3b"],
56
+    &["bbbb88", "ccc68d", "eedd99", "eec290", "eeaa88"],
57
+    &["b3cc57", "ecf081", "ffbe40", "ef746f", "ab3e5b"],
58
+    &["a3a948", "edb92e", "f85931", "ce1836", "009989"],
59
+    &["300030", "480048", "601848", "c04848", "f07241"],
60
+    &["67917a", "170409", "b8af03", "ccbf82", "e33258"],
61
+    &["aab3ab", "c4cbb7", "ebefc9", "eee0b7", "e8caaf"],
62
+    &["e8d5b7", "0e2430", "fc3a51", "f5b349", "e8d5b9"],
63
+    &["ab526b", "bca297", "c5ceae", "f0e2a4", "f4ebc3"],
64
+    &["607848", "789048", "c0d860", "f0f0d8", "604848"],
65
+    &["b6d8c0", "c8d9bf", "dadabd", "ecdbbc", "fedcba"],
66
+    &["a8e6ce", "dcedc2", "ffd3b5", "ffaaa6", "ff8c94"],
67
+    &["3e4147", "fffedf", "dfba69", "5a2e2e", "2a2c31"],
68
+    &["fc354c", "29221f", "13747d", "0abfbc", "fcf7c5"],
69
+    &["cc0c39", "e6781e", "c8cf02", "f8fcc1", "1693a7"],
70
+    &["1c2130", "028f76", "b3e099", "ffeaad", "d14334"],
71
+    &["a7c5bd", "e5ddcb", "eb7b59", "cf4647", "524656"],
72
+    &["dad6ca", "1bb0ce", "4f8699", "6a5e72", "563444"],
73
+    &["5c323e", "a82743", "e15e32", "c0d23e", "e5f04c"],
74
+    &["edebe6", "d6e1c7", "94c7b6", "403b33", "d3643b"],
75
+    &["fdf1cc", "c6d6b8", "987f69", "e3ad40", "fcd036"],
76
+    &["230f2b", "f21d41", "ebebbc", "bce3c5", "82b3ae"],
77
+    &["b9d3b0", "81bda4", "b28774", "f88f79", "f6aa93"],
78
+    &["3a111c", "574951", "83988e", "bcdea5", "e6f9bc"],
79
+    &["5e3929", "cd8c52", "b7d1a3", "dee8be", "fcf7d3"],
80
+    &["1c0113", "6b0103", "a30006", "c21a01", "f03c02"],
81
+    &["000000", "9f111b", "b11623", "292c37", "cccccc"],
82
+    &["382f32", "ffeaf2", "fcd9e5", "fbc5d8", "f1396d"],
83
+    &["e3dfba", "c8d6bf", "93ccc6", "6cbdb5", "1a1f1e"],
84
+    &["f6f6f6", "e8e8e8", "333333", "990100", "b90504"],
85
+    &["1b325f", "9cc4e4", "e9f2f9", "3a89c9", "f26c4f"],
86
+    &["a1dbb2", "fee5ad", "faca66", "f7a541", "f45d4c"],
87
+    &["c1b398", "605951", "fbeec2", "61a6ab", "accec0"],
88
+    &["5e9fa3", "dcd1b4", "fab87f", "f87e7b", "b05574"],
89
+    &["951f2b", "f5f4d7", "e0dfb1", "a5a36c", "535233"],
90
+    &["8dccad", "988864", "fea6a2", "f9d6ac", "ffe9af"],
91
+    &["2d2d29", "215a6d", "3ca2a2", "92c7a3", "dfece6"],
92
+    &["413d3d", "040004", "c8ff00", "fa023c", "4b000f"],
93
+    &["eff3cd", "b2d5ba", "61ada0", "248f8d", "605063"],
94
+    &["ffefd3", "fffee4", "d0ecea", "9fd6d2", "8b7a5e"],
95
+    &["cfffdd", "b4dec1", "5c5863", "a85163", "ff1f4c"],
96
+    &["9dc9ac", "fffec7", "f56218", "ff9d2e", "919167"],
97
+    &["4e395d", "827085", "8ebe94", "ccfc8e", "dc5b3e"],
98
+    &["a8a7a7", "cc527a", "e8175d", "474747", "363636"],
99
+    &["f8edd1", "d88a8a", "474843", "9d9d93", "c5cfc6"],
100
+    &["046d8b", "309292", "2fb8ac", "93a42a", "ecbe13"],
101
+    &["f38a8a", "55443d", "a0cab5", "cde9ca", "f1edd0"],
102
+    &["a70267", "f10c49", "fb6b41", "f6d86b", "339194"],
103
+    &["ff003c", "ff8a00", "fabe28", "88c100", "00c176"],
104
+    &["ffedbf", "f7803c", "f54828", "2e0d23", "f8e4c1"],
105
+    &["4e4d4a", "353432", "94ba65", "2790b0", "2b4e72"],
106
+    &["0ca5b0", "4e3f30", "fefeeb", "f8f4e4", "a5b3aa"],
107
+    &["4d3b3b", "de6262", "ffb88c", "ffd0b3", "f5e0d3"],
108
+    &["fffbb7", "a6f6af", "66b6ab", "5b7c8d", "4f2958"],
109
+    &["edf6ee", "d1c089", "b3204d", "412e28", "151101"],
110
+    &["9d7e79", "ccac95", "9a947c", "748b83", "5b756c"],
111
+    &["fcfef5", "e9ffe1", "cdcfb7", "d6e6c3", "fafbe3"],
112
+    &["9cddc8", "bfd8ad", "ddd9ab", "f7af63", "633d2e"],
113
+    &["30261c", "403831", "36544f", "1f5f61", "0b8185"],
114
+    &["aaff00", "ffaa00", "ff00aa", "aa00ff", "00aaff"],
115
+    &["d1313d", "e5625c", "f9bf76", "8eb2c5", "615375"],
116
+    &["ffe181", "eee9e5", "fad3b2", "ffba7f", "ff9c97"],
117
+    &["73c8a9", "dee1b6", "e1b866", "bd5532", "373b44"],
118
+    &["805841", "dcf7f3", "fffcdd", "ffd8d8", "f5a2a2"],
119
+    &["379f7a", "78ae62", "bbb749", "e0fbac", "1f1c0d"],
120
+    &["caff42", "ebf7f8", "d0e0eb", "88abc2", "49708a"],
121
+    &["c2412d", "d1aa34", "a7a844", "a46583", "5a1e4a"],
122
+    &["75616b", "bfcff7", "dce4f7", "f8f3bf", "d34017"],
123
+    &["111625", "341931", "571b3c", "7a1e48", "9d2053"],
124
+    &["82837e", "94b053", "bdeb07", "bffa37", "e0e0e0"],
125
+    &["7e5686", "a5aad9", "e8f9a2", "f8a13f", "ba3c3d"],
126
+    &["312736", "d4838f", "d6abb1", "d9d9d9", "c4ffeb"],
127
+    &["395a4f", "432330", "853c43", "f25c5e", "ffa566"],
128
+    &["fde6bd", "a1c5ab", "f4dd51", "d11e48", "632f53"],
129
+    &["84b295", "eccf8d", "bb8138", "ac2005", "2c1507"],
130
+    &["058789", "503d2e", "d54b1a", "e3a72f", "f0ecc9"],
131
+    &["6da67a", "77b885", "86c28b", "859987", "4a4857"],
132
+    &["bed6c7", "adc0b4", "8a7e66", "a79b83", "bbb2a1"],
133
+    &["261c21", "6e1e62", "b0254f", "de4126", "eb9605"],
134
+    &["efd9b4", "d6a692", "a39081", "4d6160", "292522"],
135
+    &["e21b5a", "9e0c39", "333333", "fbffe3", "83a300"],
136
+    &["f2e3c6", "ffc6a5", "e6324b", "2b2b2b", "353634"],
137
+    &["c75233", "c78933", "d6ceaa", "79b5ac", "5e2f46"],
138
+    &["793a57", "4d3339", "8c873e", "d1c5a5", "a38a5f"],
139
+    &["512b52", "635274", "7bb0a8", "a7dbab", "e4f5b1"],
140
+    &["11644d", "a0b046", "f2c94e", "f78145", "f24e4e"],
141
+    &["59b390", "f0ddaa", "e47c5d", "e32d40", "152b3c"],
142
+    &["fdffd9", "fff0b8", "ffd6a3", "faad8e", "142f30"],
143
+    &["b5ac01", "ecba09", "e86e1c", "d41e45", "1b1521"],
144
+    &["c7fcd7", "d9d5a7", "d9ab91", "e6867a", "ed4a6a"],
145
+    &["11766d", "410936", "a40b54", "e46f0a", "f0b300"],
146
+    &["595643", "4e6b66", "ed834e", "ebcc6e", "ebe1c5"],
147
+    &["f1396d", "fd6081", "f3ffeb", "acc95f", "8f9924"],
148
+    &["331327", "991766", "d90f5a", "f34739", "ff6e27"],
149
+    &["efeecc", "fe8b05", "fe0557", "400403", "0aabba"],
150
+    &["bf496a", "b39c82", "b8c99d", "f0d399", "595151"],
151
+    &["b7cbbf", "8c886f", "f9a799", "f4bfad", "f5dabd"],
152
+    &["ffb884", "f5df98", "fff8d4", "c0d1c2", "2e4347"],
153
+    &["e5eaa4", "a8c4a2", "69a5a4", "616382", "66245b"],
154
+    &["e0eff1", "7db4b5", "ffffff", "680148", "000000"],
155
+    &["b1e6d1", "77b1a9", "3d7b80", "270a33", "451a3e"],
156
+    &["e4ded0", "abccbd", "7dbeb8", "181619", "e32f21"],
157
+    &["e9e0d1", "91a398", "33605a", "070001", "68462b"],
158
+    &["fc284f", "ff824a", "fea887", "f6e7f7", "d1d0d7"],
159
+    &["ffab07", "e9d558", "72ad75", "0e8d94", "434d53"],
160
+    &["6da67a", "99a66d", "a9bd68", "b5cc6a", "c0de5d"],
161
+    &["311d39", "67434f", "9b8e7e", "c3ccaf", "a51a41"],
162
+    &["cfb590", "9e9a41", "758918", "564334", "49281f"],
163
+    &["5cacc4", "8cd19d", "cee879", "fcb653", "ff5254"],
164
+    &["44749d", "c6d4e1", "ffffff", "ebe7e0", "bdb8ad"],
165
+    &["807462", "a69785", "b8faff", "e8fdff", "665c49"],
166
+    &["e7edea", "ffc52c", "fb0c06", "030d4f", "ceecef"],
167
+    &["ccf390", "e0e05a", "f7c41f", "fc930a", "ff003d"],
168
+    &["2b222c", "5e4352", "965d62", "c7956d", "f2d974"],
169
+    &["cc5d4c", "fffec6", "c7d1af", "96b49c", "5b5847"],
170
+    &["e4e4c5", "b9d48b", "8d2036", "ce0a31", "d3e4c5"],
171
+    &["e3e8cd", "bcd8bf", "d3b9a3", "ee9c92", "fe857e"],
172
+    &["360745", "d61c59", "e7d84b", "efeac5", "1b8798"],
173
+    &["ec4401", "cc9b25", "13cd4a", "7b6ed6", "5e525c"],
174
+    &["eb9c4d", "f2d680", "f3ffcf", "bac9a9", "697060"],
175
+    &["f2e8c4", "98d9b6", "3ec9a7", "2b879e", "616668"],
176
+    &["f5dd9d", "bcc499", "92a68a", "7b8f8a", "506266"],
177
+    &["fff3db", "e7e4d5", "d3c8b4", "c84648", "703e3b"],
178
+    &["041122", "259073", "7fda89", "c8e98e", "e6f99d"],
179
+    &["8d7966", "a8a39d", "d8c8b8", "e2ddd9", "f8f1e9"],
180
+    &["c6cca5", "8ab8a8", "6b9997", "54787d", "615145"],
181
+    &["1d1313", "24b694", "d22042", "a3b808", "30c4c9"],
182
+    &["4b1139", "3b4058", "2a6e78", "7a907c", "c9b180"],
183
+    &["2d1b33", "f36a71", "ee887a", "e4e391", "9abc8a"],
184
+    &["f0ffc9", "a9da88", "62997a", "72243d", "3b0819"],
185
+    &["429398", "6b5d4d", "b0a18f", "dfcdb4", "fbeed3"],
186
+    &["9d9e94", "c99e93", "f59d92", "e5b8ad", "d5d2c8"],
187
+    &["95a131", "c8cd3b", "f6f1de", "f5b9ae", "ee0b5b"],
188
+    &["322938", "89a194", "cfc89a", "cc883a", "a14016"],
189
+    &["540045", "c60052", "ff714b", "eaff87", "acffe9"],
190
+    &["79254a", "795c64", "79927d", "aeb18e", "e3cf9e"],
191
+    &["452e3c", "ff3d5a", "ffb969", "eaf27e", "3b8c88"],
192
+    &["2b2726", "0a516d", "018790", "7dad93", "bacca4"],
193
+    &["027b7f", "ffa588", "d62957", "bf1e62", "572e4f"],
194
+    &["fa6a64", "7a4e48", "4a4031", "f6e2bb", "9ec6b8"],
195
+    &["fb6900", "f63700", "004853", "007e80", "00b9bd"],
196
+    &["f06d61", "da825f", "c4975c", "a8ab7b", "8cbf99"],
197
+    &["23192d", "fd0a54", "f57576", "febf97", "f5ecb7"],
198
+    &["f6d76b", "ff9036", "d6254d", "ff5475", "fdeba9"],
199
+    &["a3c68c", "879676", "6e6662", "4f364a", "340735"],
200
+    &["a32c28", "1c090b", "384030", "7b8055", "bca875"],
201
+    &["80a8a8", "909d9e", "a88c8c", "ff0d51", "7a8c89"],
202
+    &["6d9788", "1e2528", "7e1c13", "bf0a0d", "e6e1c2"],
203
+    &["373737", "8db986", "acce91", "badb73", "efeae4"],
204
+    &["e6b39a", "e6cba5", "ede3b4", "8b9e9b", "6d7578"],
205
+    &["280904", "680e34", "9a151a", "c21b12", "fc4b2a"],
206
+    &["4b3e4d", "1e8c93", "dbd8a2", "c4ac30", "d74f33"],
207
+    &["161616", "c94d65", "e7c049", "92b35a", "1f6764"],
208
+    &["234d20", "36802d", "77ab59", "c9df8a", "f0f7da"],
209
+    &["a69e80", "e0ba9b", "e7a97e", "d28574", "3b1922"],
210
+    &["641f5e", "676077", "65ac92", "c2c092", "edd48e"],
211
+    &["e6eba9", "abbb9f", "6f8b94", "706482", "703d6f"],
212
+    &["26251c", "eb0a44", "f2643d", "f2a73d", "a0e8b7"],
213
+    &["fdcfbf", "feb89f", "e23d75", "5f0d3b", "742365"],
214
+    &["ff7474", "f59b71", "c7c77f", "e0e0a8", "f1f1c1"],
215
+    &["4f364c", "5e405f", "6b6b6b", "8f9e6f", "b1cf72"],
216
+    &["230b00", "a29d7f", "d4cfa5", "f8ecd4", "aabe9b"],
217
+    &["d4f7dc", "dbe7b4", "dbc092", "e0846d", "f51441"],
218
+    &["62a07b", "4f8b89", "536c8d", "5c4f79", "613860"],
219 219
 ];

+ 0
- 8
core/src/compiler.rs View File

@@ -2675,14 +2675,6 @@ mod tests {
2675 2675
         }
2676 2676
     }
2677 2677
 
2678
-    fn load_void() -> Bytecode {
2679
-        Bytecode {
2680
-            op: Opcode::LOAD,
2681
-            arg0: BytecodeArg::Mem(Mem::Void),
2682
-            arg1: BytecodeArg::Int(0),
2683
-        }
2684
-    }
2685
-
2686 2678
     fn lt() -> Bytecode {
2687 2679
         bytecode_from_opcode(Opcode::LT)
2688 2680
     }

+ 58
- 58
core/src/lib.rs View File

@@ -185,62 +185,62 @@ pub mod tests {
185 185
     }
186 186
 
187 187
     // #[test]
188
-    fn explore_1() {
189
-        // vm.ip wasn't being set to 0 in-between running the preamble and running the user's program
190
-        let mut vm: Vm = Default::default();
191
-        let mut context: Context = Default::default();
192
-        let s = "
193
-
194
-(define
195
-  coords1 {[[-3.718 -69.162]
196
-            [463.301 -57.804]
197
-            [456.097 -315.570]
198
-            [318.683 -384.297]]
199
-           (gen/2d min: -500 max: 500)}
200
-  coords2 {[[424.112 19.779]
201
-            [2.641 246.678]
202
-            [-449.001 -79.842]
203
-            [37.301 206.818]]
204
-           (gen/2d min: -500 max: 500)}
205
-  coords3 {[[83.331 -282.954]
206
-            [92.716 -393.120]
207
-            [426.686 -420.284]
208
-            [-29.734 335.671]]
209
-           (gen/2d min: -500 max: 500)}
210
-
211
-  col-fn-1 (col/build-procedural preset: {transformers (gen/select from: col/procedural-fn-presets)}
212
-                                 alpha: 0.08)
213
-  col-fn-2 (col/build-procedural preset: {mars (gen/select from: col/procedural-fn-presets)}
214
-                                 alpha: 0.08)
215
-  col-fn-3 (col/build-procedural preset: {knight-rider (gen/select from: col/procedural-fn-presets)}
216
-                                 alpha: 0.08)
217
-
218
-  num-copies {28 (gen/int min: 1 max: 28)}
219
-  squish (interp/build from: [0 (- num-copies 1)] to: [{1.2 (gen/scalar max: 2)} {0.45 (gen/scalar max: 2)}]))
220
-
221
-(fn (draw angle: 0 copy: 0)
222
-  (scale vector: [(interp/value from: squish t: copy) (interp/value from: squish t: copy)])
223
-  (fence (t num: 200)
224
-    (poly coords: [(interp/bezier t: t coords: coords1)
225
-                   (interp/bezier t: t coords: coords2)
226
-                   (interp/bezier t: t coords: coords3)]
227
-          colours: [(col/value from: col-fn-1 t: t)
228
-                    (col/value from: col-fn-2 t: t)
229
-                    (col/value from: col-fn-3 t: t)])))
230
-
231
-(fn (render)
232
-  (rect position: [500 500]
233
-        width: 1000
234
-        height: 1000
235
-        colour: (col/value from: col-fn-1 t: 0.5))
236
-  (on-matrix-stack
237
-    (translate vector: [(/ canvas/width 2) (/ canvas/height 2)])
238
-    (scale vector: [0.8 0.8])
239
-    (repeat/rotate-mirrored fn: (address-of draw)
240
-                            copies: num-copies)))
241
-
242
-(render)
243
-";
244
-        is_rendering_num_verts(&mut vm, &mut context, &s, 1246);
245
-    }
188
+    //     fn explore_1() {
189
+    //         // vm.ip wasn't being set to 0 in-between running the preamble and running the user's program
190
+    //         let mut vm: Vm = Default::default();
191
+    //         let mut context: Context = Default::default();
192
+    //         let s = "
193
+
194
+    // (define
195
+    //   coords1 {[[-3.718 -69.162]
196
+    //             [463.301 -57.804]
197
+    //             [456.097 -315.570]
198
+    //             [318.683 -384.297]]
199
+    //            (gen/2d min: -500 max: 500)}
200
+    //   coords2 {[[424.112 19.779]
201
+    //             [2.641 246.678]
202
+    //             [-449.001 -79.842]
203
+    //             [37.301 206.818]]
204
+    //            (gen/2d min: -500 max: 500)}
205
+    //   coords3 {[[83.331 -282.954]
206
+    //             [92.716 -393.120]
207
+    //             [426.686 -420.284]
208
+    //             [-29.734 335.671]]
209
+    //            (gen/2d min: -500 max: 500)}
210
+
211
+    //   col-fn-1 (col/build-procedural preset: {transformers (gen/select from: col/procedural-fn-presets)}
212
+    //                                  alpha: 0.08)
213
+    //   col-fn-2 (col/build-procedural preset: {mars (gen/select from: col/procedural-fn-presets)}
214
+    //                                  alpha: 0.08)
215
+    //   col-fn-3 (col/build-procedural preset: {knight-rider (gen/select from: col/procedural-fn-presets)}
216
+    //                                  alpha: 0.08)
217
+
218
+    //   num-copies {28 (gen/int min: 1 max: 28)}
219
+    //   squish (interp/build from: [0 (- num-copies 1)] to: [{1.2 (gen/scalar max: 2)} {0.45 (gen/scalar max: 2)}]))
220
+
221
+    // (fn (draw angle: 0 copy: 0)
222
+    //   (scale vector: [(interp/value from: squish t: copy) (interp/value from: squish t: copy)])
223
+    //   (fence (t num: 200)
224
+    //     (poly coords: [(interp/bezier t: t coords: coords1)
225
+    //                    (interp/bezier t: t coords: coords2)
226
+    //                    (interp/bezier t: t coords: coords3)]
227
+    //           colours: [(col/value from: col-fn-1 t: t)
228
+    //                     (col/value from: col-fn-2 t: t)
229
+    //                     (col/value from: col-fn-3 t: t)])))
230
+
231
+    // (fn (render)
232
+    //   (rect position: [500 500]
233
+    //         width: 1000
234
+    //         height: 1000
235
+    //         colour: (col/value from: col-fn-1 t: 0.5))
236
+    //   (on-matrix-stack
237
+    //     (translate vector: [(/ canvas/width 2) (/ canvas/height 2)])
238
+    //     (scale vector: [0.8 0.8])
239
+    //     (repeat/rotate-mirrored fn: (address-of draw)
240
+    //                             copies: num-copies)))
241
+
242
+    // (render)
243
+    // ";
244
+    //         is_rendering_num_verts(&mut vm, &mut context, &s, 1246);
245
+    //     }
246 246
 }

+ 29
- 29
core/src/native.rs View File

@@ -3525,45 +3525,45 @@ mod tests {
3525 3525
             assert_eq!(col.e3, alpha);
3526 3526
         }
3527 3527
     }
3528
-
3529
-    // get render packet 0's geometry length
3530
-    fn rp0_num_vertices(context: &Context, expected_num_vertices: usize) {
3531
-        assert_eq!(
3532
-            context.get_render_packet_geo_len(0),
3533
-            expected_num_vertices * RENDER_PACKET_FLOAT_PER_VERTEX
3534
-        );
3535
-    }
3536
-
3537
-    // #[test]
3538
-    fn dev_rendering_fns() {
3539
-        let mut vm: Vm = Default::default();
3540
-        let mut context: Context = Default::default();
3541
-        vm_run(&mut vm, &mut context, "(line width: 33 from: [2 3] to: [400 500] colour: (col/rgb r: 0 g: 0.1 b: 0.2 alpha: 0.3))");
3542
-        // vm_run(&mut vm, "(line width: 0 from: [2 3] to: [400 500] brush: brush/b colour: (col/rgb r: 0 g: 0.1 b: 0.2 alpha: 0.3))");
3543
-        // vm_run(&mut vm, "(line brush: brush/b)");
3544
-        // vm_run(&mut vm, "(line brush: brush/b) (rect width: 10 height: 30)");
3545
-
3546
-        let res = vm.top_stack_value().unwrap();
3547
-        if let Var::Debug(s) = res {
3548
-            assert_eq!(s, "x");
3549
-        } else {
3550
-            assert_eq!(false, true);
3528
+    /*
3529
+        // get render packet 0's geometry length
3530
+        fn rp0_num_vertices(context: &Context, expected_num_vertices: usize) {
3531
+            assert_eq!(
3532
+                context.get_render_packet_geo_len(0),
3533
+                expected_num_vertices * RENDER_PACKET_FLOAT_PER_VERTEX
3534
+            );
3551 3535
         }
3552 3536
 
3553
-        rp0_num_vertices(&context, 4);
3554
-    }
3537
+        // #[test]
3538
+        fn dev_rendering_fns() {
3539
+            let mut vm: Vm = Default::default();
3540
+            let mut context: Context = Default::default();
3541
+            vm_run(&mut vm, &mut context, "(line width: 33 from: [2 3] to: [400 500] colour: (col/rgb r: 0 g: 0.1 b: 0.2 alpha: 0.3))");
3542
+            // vm_run(&mut vm, "(line width: 0 from: [2 3] to: [400 500] brush: brush/b colour: (col/rgb r: 0 g: 0.1 b: 0.2 alpha: 0.3))");
3543
+            // vm_run(&mut vm, "(line brush: brush/b)");
3544
+            // vm_run(&mut vm, "(line brush: brush/b) (rect width: 10 height: 30)");
3545
+
3546
+            let res = vm.top_stack_value().unwrap();
3547
+            if let Var::Debug(s) = res {
3548
+                assert_eq!(s, "x");
3549
+            } else {
3550
+                assert_eq!(false, true);
3551
+            }
3555 3552
 
3553
+            rp0_num_vertices(&context, 4);
3554
+        }
3555
+    */
3556 3556
     #[test]
3557 3557
     fn test_native_pack() {
3558 3558
         let mut res: String = "".to_string();
3559
-        Native::ColGetAlpha.pack(&mut res).unwrap();
3560
-        assert_eq!("col/get-alpha", res);
3559
+        Native::ColAlpha.pack(&mut res).unwrap();
3560
+        assert_eq!("col/alpha", res);
3561 3561
     }
3562 3562
 
3563 3563
     #[test]
3564 3564
     fn test_native_unpack() {
3565
-        let (res, _rem) = Native::unpack("col/get-alpha").unwrap();
3566
-        assert_eq!(res, Native::ColGetAlpha);
3565
+        let (res, _rem) = Native::unpack("col/alpha").unwrap();
3566
+        assert_eq!(res, Native::ColAlpha);
3567 3567
     }
3568 3568
 
3569 3569
     #[test]

+ 9
- 9
core/src/trait_list.rs View File

@@ -335,15 +335,15 @@ mod tests {
335 335
         }
336 336
     }
337 337
 
338
-    fn trait_multiple_float(t: &Trait, expected: f32, index: usize) {
339
-        assert_eq!(t.within_vector, true);
340
-        assert_eq!(t.index, index);
341
-        if let Var::Float(f) = t.initial_value {
342
-            assert_eq!(f, expected);
343
-        } else {
344
-            assert!(false);
345
-        }
346
-    }
338
+    // fn trait_multiple_float(t: &Trait, expected: f32, index: usize) {
339
+    //     assert_eq!(t.within_vector, true);
340
+    //     assert_eq!(t.index, index);
341
+    //     if let Var::Float(f) = t.initial_value {
342
+    //         assert_eq!(f, expected);
343
+    //     } else {
344
+    //         assert!(false);
345
+    //     }
346
+    // }
347 347
 
348 348
     fn trait_multiple_v2d(t: &Trait, expected_x: f32, expected_y: f32, index: usize) {
349 349
         assert_eq!(t.within_vector, true);

Loading…
Cancel
Save