@@ -280,60 +280,6 @@ Rebol [
280
280
===end-group===
281
281
282
282
283
- ===start-group=== "TRIM"
284
- --test-- "trim string!"
285
- str1: " a b c "
286
- str2: " ^(A0) ^- a b ^- c ^(2000) "
287
- mstr: { a ^- 1^/ ab2^- ^/ ac3 ^/ ^/^/ }
288
- --assert "a b c" = trim copy str1
289
- --assert "a b c" = trim/head/tail copy str1
290
- --assert "a b c " = trim/head copy str1
291
- --assert " a b c" = trim/tail copy str1
292
- ; --assert "a b ^- c" = trim copy str2 ;- not like Red!
293
- --assert "a ^- 1^/ ab2^/ ac3^/ " = trim copy mstr
294
- --assert "a1ab2ac3" = trim/all { a ^- 1^/ ab2^- ^/ ac3 ^/ ^/^/ }
295
- --assert " ^- 1^/ b2^- ^/ c3 ^/ ^/^/ " = trim/with copy mstr #"a"
296
- --assert " ^- 1^/ b2^- ^/ c3 ^/ ^/^/ " = trim/with copy mstr 97
297
- --test-- "trim binary!"
298
- ;@@ https://github.com/Oldes/Rebol-issues/issues/1482
299
- bin: #{ 0011001100 }
300
- --assert #{ 110011 } = trim copy bin
301
- --assert #{ 110011 } = trim/head/tail copy bin
302
- --assert #{ 11001100 } = trim/head copy bin
303
- --assert #{ 00110011 } = trim/tail copy bin
304
- --assert #{ 1111 } = trim/all copy bin
305
- --assert #{ 000000 } = trim/all/with copy bin #{ 11 }
306
- --assert #{} = trim #{ 0000 }
307
- --assert #{} = trim/tail #{ 0000 }
308
- --assert #{} = trim/head #{ 0000 }
309
- --assert #{ 2061626320 } = trim/head/tail to-binary " abc "
310
- --test-- "trim binary! incompatible"
311
- --assert all [error? e: try [trim/auto #{ 00 } ] e/id = 'bad-refines]
312
- --assert all [error? e: try [trim/lines #{ 00 } ] e/id = 'bad-refines]
313
- --assert all [error? e: try [trim/head/all #{ 00 } ] e/id = 'bad-refines]
314
- --assert all [error? e: try [trim/tail/all #{ 00 } ] e/id = 'bad-refines]
315
- --assert all [error? e: try [trim/tail/with #{ 00 } 0 ] e/id = 'bad-refines]
316
- --assert all [error? e: try [trim/head/with #{ 00 } 0 ] e/id = 'bad-refines]
317
- --test-- "trim binary! with index > 1"
318
- bin: #{ 0000110000 }
319
- --assert #{ 00001100 } = head trim/tail at copy bin 5
320
- --assert #{ 00110000 } = head trim/head at copy bin 2
321
- --assert #{ 0011 } = head trim/all at copy bin 2
322
- --test-- "trim block!"
323
- blk: [#[none] 1 #[none] 2 #[none]]
324
- ;@@ https://github.com/Oldes/Rebol-issues/issues/825
325
- --assert [1 #[none] 2 #[none]] = trim/head copy blk
326
- --assert [#[none] 1 #[none] 2 ] = trim/tail copy blk
327
- ;@@ https://github.com/Oldes/Rebol-issues/issues/2482
328
- --assert [1 #[none] 2 ] = trim copy blk
329
- --assert [1 2 ] = trim/all copy blk
330
- --assert all [error? e: try [trim/head/all []] e/id = 'bad-refines]
331
- --assert all [error? e: try [trim/tail/all []] e/id = 'bad-refines]
332
-
333
- ===end-group===
334
-
335
-
336
-
337
283
===start-group=== "REPLACE string!"
338
284
;@@ https://github.com/Oldes/Rebol-issues/issues/54
339
285
--test-- "issue-54"
@@ -866,18 +812,6 @@ Rebol [
866
812
unset? pick b 2
867
813
unset? b/2
868
814
]
869
- --test-- "out of range"
870
- ;@@ https://github.com/Oldes/Rebol-issues/issues/1057
871
- a: #{ 0102 }
872
- --assert 3 = poke a 1 3
873
- --assert a = #{ 0302 }
874
- --assert all [error? e: try [poke a 1 300 ] e/id = 'out-of-range]
875
- --assert 4 = a/1: 4
876
- --assert a = #{ 0402 }
877
- --assert all [error? e: try [a/1: 400 ] e/id = 'out-of-range]
878
- --assert #{ 02 } = change a 5
879
- --assert a = #{ 0502 }
880
- --assert all [error? e: try [change a 500 ] e/id = 'out-of-range]
881
815
===end-group===
882
816
883
817
===start-group=== "POKEZ"
@@ -969,22 +903,6 @@ Rebol [
969
903
--assert 3 = length? x
970
904
x: copy [] insert /dup x 5 -1
971
905
--assert 0 = length? x
972
- --test-- "insert/part"
973
- ;@@ https://github.com/Oldes/Rebol-issues/issues/856
974
- a: make block! 10
975
- b: at [1 2 3 4 5 6 7 8 9 ] 5
976
- --assert tail? insert /part a b 2
977
- --assert a = [5 6 ]
978
- insert /part clear a b 2147483647
979
- --assert a = [5 6 7 8 9 ]
980
- insert /part clear a b -2
981
- --assert a = [3 4 ]
982
- insert /part clear a b -2147483647
983
- --assert a = [1 2 3 4 ]
984
- --assert all [error? e: try [insert /part clear a b 2147483648 ] e/id = 'out-of-range]
985
- --assert all [error? e: try [insert /part clear a b -2147483649 ] e/id = 'out-of-range]
986
-
987
-
988
906
989
907
===end-group===
990
908
@@ -1179,20 +1097,6 @@ Rebol [
1179
1097
--assert not past? b
1180
1098
===end-group===
1181
1099
1182
- ===start-group=== "SNGLE?"
1183
- --test-- "single? block"
1184
- ;@@ https://github.com/Oldes/Rebol-issues/issues/875
1185
- --assert single? [a]
1186
- --assert single? next [a b]
1187
- --assert not single? [a b]
1188
- --assert not single? []
1189
- --test-- "single? string!"
1190
- --assert single? "a"
1191
- --assert single? next "ab"
1192
- --assert not single? "ab"
1193
- --assert not single? ""
1194
- ===end-group===
1195
-
1196
1100
1197
1101
===start-group=== "SORT"
1198
1102
@@ -1268,6 +1172,16 @@ Rebol [
1268
1172
--assert ["fred" "Fred" "FRED" ] == sort ["fred" "Fred" "FRED" ]
1269
1173
--assert ["FRED" "Fred" "fred" ] == sort/case ["Fred" "fred" "FRED" ]
1270
1174
1175
+ --test-- "SORT with NaN"
1176
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2493
1177
+ ; using `mold` in this test, because currently `(1.#NaN = 1.#NaN) == false` and so the test would fail!
1178
+ --assert "[-1.#INF -1.0 0 1.0 1.#INF 1.#NaN 1.#NaN]" = mold sort [1. #inf -1.0 1. #nan 1.0 -1. #inf 0 1. #NAN ]
1179
+ --assert "[-1.#INF -1.0 0 1.0 1.#INF 1.#NaN 1.#NaN]" = mold sort [1. #inf -1.0 1. #nan 1.0 -1. #inf 1. #NAN 0 ]
1180
+ --assert "[-1.#INF -1.0 0 1.0 1.#INF 1.#NaN 1.#NaN]" = mold sort [1. #inf -1.0 1. #nan 1.0 1. #NAN -1. #inf 0 ]
1181
+ --assert "[-1.#INF -1.0 0 1.0 1.#INF 1.#NaN 1.#NaN]" = mold sort [1. #inf -1.0 1. #nan 1. #NAN 1.0 -1. #inf 0 ]
1182
+ --assert "[-1.#INF -1.0 0 1.0 1.#INF 1.#NaN 1.#NaN]" = mold sort [1. #inf 1. #NAN -1.0 1. #nan 1.0 -1. #inf 0 ]
1183
+ --assert "[-1.#INF -1.0 0 1.0 1.#INF 1.#NaN 1.#NaN]" = mold sort [1. #NAN 1. #inf -1.0 1. #nan 1.0 -1. #inf 0 ]
1184
+
1271
1185
===end-group===
1272
1186
1273
1187
@@ -1576,15 +1490,6 @@ Rebol [
1576
1490
;--assert txt = iconv #{FFFE50005901690068006C00E100730069007400} 'UTF16
1577
1491
--assert (next txt) = iconv next #{ 50F869686CE1736974 } 28592
1578
1492
1579
- --test-- "ICONV from UTF-8"
1580
- ;@@ https://github.com/Oldes/Rebol-issues/issues/2475
1581
- --assert "š" = iconv #{ C5A1 } 'utf8
1582
- --assert "š" = iconv #{ C5A1 } 'utf-8
1583
- --assert "š" = iconv #{ C5A1 } 'UTF8
1584
- --assert "š" = iconv #{ C5A1 } 'UTF-8
1585
- --assert "š" = iconv #{ C5A1 } 'CP65001
1586
- --assert "š" = iconv #{ C5A1 } 65001
1587
-
1588
1493
--test-- "ICONV with empty imput"
1589
1494
--assert "" = iconv #{} 28592
1590
1495
--assert "" = iconv #{} 'utf8
@@ -1816,12 +1721,6 @@ Rebol [
1816
1721
--assert "<a<b b>>" = mold append <a > <b b >
1817
1722
--assert "<a<b b>>" = mold join <a > <b b >
1818
1723
1819
- --test-- "CRLF inside tag"
1820
- ;@@ https://github.com/Oldes/Rebol-issues/issues/1233
1821
- ; CRLF is not automatically converted inside tags
1822
- --assert #{ 410D0A } = to-binary first transcode #{ 3C410D0A3E }
1823
- --assert #{ 410A } = to-binary deline first transcode #{ 3C410D0A3E }
1824
-
1825
1724
===end-group===
1826
1725
1827
1726
@@ -1898,13 +1797,6 @@ Rebol [
1898
1797
--assert block? random next [1 2 ]
1899
1798
--assert integer? random/only next [1 2 ]
1900
1799
1901
- --test-- "copy/part limit"
1902
- ;@@ https://github.com/Oldes/Rebol-issues/issues/853
1903
- --assert [1 ] = copy/part tail [1 ] -2147483647
1904
- --assert [1 ] = copy/part tail [1 ] -2147483648
1905
- --assert all [error? e: try [copy/part tail [1 ] -2147483649 ] e/id = 'out-of-range]
1906
-
1907
-
1908
1800
===end-group===
1909
1801
1910
1802
@@ -2004,19 +1896,6 @@ Rebol [
2004
1896
;@@ https://github.com/Oldes/Rebol-issues/issues/690
2005
1897
--assert (split "This! is a. test? to see " charset "!?." ) = ["This" " is a" " test" " to see " ]
2006
1898
2007
- --test-- "split/at"
2008
- ;@@ https://github.com/Oldes/Rebol-issues/issues/2490
2009
- --assert (split/at "a:b" #":" ) = ["a" "b" ]
2010
- --assert (split/at "a:b:c" #":" ) = ["a" "b:c" ]
2011
- --assert (split/at "a" #":" ) = ["a" ]
2012
- --assert (split/at "a:" #":" ) = ["a" "" ]
2013
- --assert (split/at ":b" #":" ) = ["" "b" ]
2014
- --assert (split/at [1 a 2 ] 'a) = [[1 ] [2 ]]
2015
- --assert (split/at [1 a 2 3 ] 'a) = [[1 ] [2 3 ]]
2016
- --assert (split/at [1 a 2 a 3 ] 'a) = [[1 ] [2 a 3 ]]
2017
- --assert (split/at [1 2 ] 'a) = [[1 2 ]]
2018
-
2019
-
2020
1899
===end-group===
2021
1900
2022
1901
@@ -2184,8 +2063,6 @@ Rebol [
2184
2063
--assert [#[none] #[none]] = array 2
2185
2064
--test-- "array/initial"
2186
2065
--assert [0 0 ] = array/initial 2 0
2187
- ;@@ https://github.com/Oldes/Rebol-issues/issues/360
2188
- --assert [["" "" ] ["" "" ]] = array/initial [2 2 ] ""
2189
2066
--test-- "array/initial func"
2190
2067
;@@ https://github.com/Oldes/Rebol-issues/issues/2193
2191
2068
--assert [10 9 8 7 6 5 4 3 2 1 ] = array/initial length: 10 func [] [-- length]
@@ -2258,13 +2135,6 @@ Rebol [
2258
2135
2259
2136
===end-group===
2260
2137
2261
- ===start-group=== "MOVE"
2262
- --test-- "move/skip"
2263
- ;@@ https://github.com/Oldes/Rebol-issues/issues/740
2264
- --assert all [error? e: try [move/skip [1 2 3 ] 2 0 ] e/id = 'out-of-range]
2265
-
2266
- ===end-group===
2267
-
2268
2138
;-- VECTOR related tests moved to %vector-test.r3
2269
2139
2270
2140
~~~end-file~~~
0 commit comments