@@ -69,22 +69,55 @@ Rebol [
69
69
70
70
===end-group===
71
71
72
- ===start-group=== "INDEX? / INDEXZ?"
72
+ ===start-group=== "INDEX? / INDEXZ? / AT / ATZ "
73
73
img: make image! 2x2
74
74
--test-- "index? image!"
75
- --assert 1 = index? img
76
- --assert 2 = index? next img
77
- --assert 5 = index? tail img
75
+ --assert 1 = index? img
76
+ --assert 2 = index? next img
77
+ --assert 5 = index? tail img
78
+ --assert 4 = index? skip tail img -1
79
+ --test-- "index? at image!"
80
+ --assert 1 = index? at img -1
81
+ --assert 1 = index? at img 0
82
+ --assert 1 = index? at img 1
83
+ --assert 2 = index? at img 2
84
+ --assert 5 = index? at img 6
85
+ --assert 1 = index? skip at img 2 -1
86
+ --test-- "index?/xy image!"
78
87
--assert 1x1 = index?/xy img
79
88
--assert 2x1 = index?/xy next img
80
89
--assert 1x3 = index?/xy tail img
90
+ --assert 2x2 = index?/xy skip tail img -1
91
+ --test-- "index?/xy at image!"
92
+ --assert 1x1 = index?/xy at img 1x1
93
+ --assert 1x2 = index?/xy at img 1x2
94
+ --assert 2x2 = index?/xy at img 2x2
95
+ --assert 1x3 = index?/xy at img 20x2
96
+ --assert 1x2 = index?/xy skip at img 2x2 -1x0
81
97
--test-- "indexz? image!"
82
- --assert 0 = indexz? img
83
- --assert 1 = indexz? next img
84
- --assert 4 = indexz? tail img
98
+ --assert 0 = indexz? img
99
+ --assert 1 = indexz? next img
100
+ --assert 4 = indexz? tail img
101
+ --assert 3 = indexz? skip tail img -1
102
+ --test-- "indexz? atz image!"
103
+ --assert 0 = indexz? atz img -1
104
+ --assert 0 = indexz? atz img 0
105
+ --assert 2 = indexz? atz img 2
106
+ --assert 4 = indexz? atz img 6
107
+ --assert 3 = indexz? skip atz img 6 -1
108
+ --assert 1 = indexz? skip atz img 2 -1
109
+ --test-- "indexz?/xy image!"
85
110
--assert 0x0 = indexz?/xy img
86
111
--assert 1x0 = indexz?/xy next img
87
112
--assert 0x2 = indexz?/xy tail img
113
+ --assert 1x1 = indexz?/xy skip tail img -1x0
114
+ --test-- "indexz?/xy atz image!"
115
+ --assert 0x0 = indexz?/xy atz img 0x0
116
+ --assert 0x1 = indexz?/xy atz img 0x1
117
+ --assert 1x1 = indexz?/xy atz img 1x1
118
+ --assert 0x2 = indexz?/xy atz img 2x2
119
+ --assert 0x2 = indexz?/xy atz img 20x2
120
+ --assert 0x1 = indexz?/xy skip atz img 1x1 -1x0
88
121
===end-group===
89
122
90
123
===start-group=== "FOREACH"
@@ -250,26 +283,26 @@ Rebol [
250
283
000000000000FFFFFFFFFFFF
251
284
FFFFFFFFFFFFFFFFFFFFFFFF
252
285
FFFFFFFFFFFFFFFFFFFFFFFF }
253
- change at img 1x1 make image! [2x2 220.22.22]
286
+ change at img 2x2 make image! [2x2 220.22.22]
254
287
--assert img/rgb = #{
255
288
000000000000FFFFFFFFFFFF
256
289
000000DC1616DC1616FFFFFF
257
290
FFFFFFDC1616DC1616FFFFFF
258
291
FFFFFFFFFFFFFFFFFFFFFFFF }
259
- change at img 2x2 make image! [3x3 33.33.33]
292
+ change at img 3x3 make image! [3x3 33.33.33]
260
293
--assert img/rgb = #{
261
294
000000000000FFFFFFFFFFFF
262
295
000000DC1616DC1616FFFFFF
263
296
FFFFFFDC1616212121212121
264
297
FFFFFFFFFFFF212121212121 }
265
- change at img 0x3 make image! [4x4 66.166.66]
298
+ change at img 1x4 make image! [4x4 66.166.66]
266
299
--assert img/rgb = #{
267
300
000000000000FFFFFFFFFFFF
268
301
000000DC1616DC1616FFFFFF
269
302
FFFFFFDC1616212121212121
270
303
42A64242A64242A64242A642 }
271
304
272
- change at img 3x0 make image! [2x1 #{ AAAAAABBBBBB } ]
305
+ change at img 4x1 make image! [2x1 #{ AAAAAABBBBBB } ]
273
306
--assert img/rgb = #{
274
307
000000000000FFFFFFAAAAAA
275
308
000000DC1616DC1616FFFFFF
0 commit comments