Skip to content

Commit

Permalink
TEST: moving known units test issues into separate file and commentin…
Browse files Browse the repository at this point in the history
…g these in main test files so it is easier to find regressions
  • Loading branch information
Oldes committed May 28, 2020
1 parent d8c08bb commit 54c0518
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/tests/run-tests.r3
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ dt [ ;- delta time
%units/poly1305-test.r3
%units/rc4-test.r3
%units/rsa-test.r3
;- known issues - waiting for fix
;%units/_known-issues_.r3
][
try/except [wrap load file] func[error][
repend failed-units [file error]
Expand Down
89 changes: 89 additions & 0 deletions src/tests/units/_known-issues_.r3
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
Rebol [
Title: "Rebol3 known (not yet fixed) issues"
Author: "Oldes, Peter W A Wood"
File: %word-test.r3
Tabs: 4
Needs: [%../quick-test-module.r3]
]

~~~start-file~~~ "KNOWN PROBLEMS!"

===start-group=== "MAP"
;@@ https://github.com/Oldes/Rebol-issues/issues/1872
--test-- "map-issue-1872"
m: map [a: 42]
protect m
--assert protected? 'm/a ;@@ <--- fails!

===end-group===


===start-group=== "SERIES"
--test-- "AS with protect"
b: protect [a b]
--assert path? try [p: as path! b]
--assert protected? b
--assert protected? p ;@@ <--- fails!
===end-group===


===start-group=== "PARSE"
--test-- "parse remove"
--assert parse v: "yx" [some [remove #"y" | #"x"] ]
--assert v = "x"
--assert parse "yx" [copy v any [ remove #"y" | #"x" ] ]
--assert v = "x"
===end-group===


===start-group=== "TIME"
;@@ https://github.com/Oldes/Rebol-issues/issues/2416
--test-- "time protect 1"
t: now/time protect 't
--assert error? e: try [t/hour: 0]
--assert e/id = 'locked-word
--test-- "time protect 2"
protect/words o: object [t: now/time]
--assert error? e: try [o/t/hour: 0]
--assert e/id = 'locked-word
--test-- "time protect 3"
o: object [t: 1 protect/words o: object [t: now/time]]
--assert protected? 'o/o/t
--assert protected? 'o/o/t/hour ;@@ <--- fails!
--assert error? e: try [o/o/t/hour: 0] ;@@ <--- fails!
===end-group===


===start-group=== "DATE"
;@@ https://github.com/Oldes/Rebol-issues/issues/2416
--test-- "date protect 1"
d: now protect 'd
--assert error? e: try [d/year: 0]
--assert e/id = 'locked-word
unprotect 'd
--test-- "date protect 2"
protect/words o: object [d: now]
--assert error? e: try [o/d/year: 0]
--assert e/id = 'locked-word
--test-- "date protect 3"
o: object [d: 1 protect/words o: object [d: now]]
--assert protected? 'o/o/d
--assert protected? 'o/o/d/year ;@@ <--- fails!
--assert error? e: try [o/o/d/year: 0] ;@@ <--- fails!
===end-group===


===start-group=== "CRASH"
--test-- "issue-1865"
;@@ https://github.com/Oldes/Rebol-issues/issues/1865
;--assert object? resolve/extend/only context [] context [a1: a2: a3: a4: a5: a6: none] [a] ;- no crash!
;-- PROBLEM! above code sometimes causes failed bind table check (using: `evoke 3`)
;-- probably related to the next test too!

--test-- "issue-2017"
;@@ https://github.com/Oldes/Rebol-issues/issues/2017
--assert object? resolve/extend/only context [] context [a: none] [a] ;- no crash!

===end-group===

~~~end-file~~~
19 changes: 19 additions & 0 deletions src/tests/units/date-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ Rebol [
;@@ https://github.com/Oldes/Rebol-issues/issues/276
--assert error? try [0 - 1-jan-0000] ;- no crash!


===end-group===

===start-group=== "date protect"
; ;@@ https://github.com/Oldes/Rebol-issues/issues/2416
; --test-- "date protect 1"
; d: now protect 'd
; --assert error? e: try [d/year: 0]
; --assert e/id = 'locked-word
; unprotect 'd
; --test-- "date protect 2"
; protect/words o: object [d: now]
; --assert error? e: try [o/d/year: 0]
; --assert e/id = 'locked-word
; --test-- "date protect 3"
; o: object [d: 1 protect/words o: object [d: now]]
; --assert protected? 'o/o/d
; --assert protected? 'o/o/d/year ;@@ <--- fails!
; --assert error? e: try [o/o/d/year: 0] ;@@ <--- fails!
===end-group===

===start-group=== "DATE/TIMEZONE"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/units/map-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Rebol [
m: map [a: 42]
protect m
--assert protected? m
--assert protected? 'm/a ;@@ <--- fails!
;--assert protected? 'm/a ;@@ <--- fails!
--assert error? err: try [m/a: 0]
--assert err/id = 'protected
--assert 42 = try [m/a]
Expand Down
8 changes: 8 additions & 0 deletions src/tests/units/parse-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ Rebol [

===end-group===

===start-group=== "REMOVE"
--test-- "remove"
;--assert parse v: "yx" [some [remove #"y" | #"x"] ]
;--assert v = "x"
;--assert parse "yx" [copy v any [ remove #"y" | #"x" ] ]
;--assert v = "x"
===end-group===

===start-group=== "Modifiers on protected series"
;@@ https://github.com/Oldes/Rebol-issues/issues/2290
s: protect "aaa"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/units/series-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ Rebol [
b: protect [a b]
--assert path? try [p: as path! b]
--assert protected? b
--assert protected? p ;@@ <--- fails!
;--assert protected? p ;@@ <--- fails!
--assert error? e: try [append b 'c]
--assert e/id = 'protected
--assert error? e: try [append p 'c]
Expand Down
17 changes: 17 additions & 0 deletions src/tests/units/time-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,21 @@ Rebol [

===end-group===

;===start-group=== "time protect"
; ;@@ https://github.com/Oldes/Rebol-issues/issues/2416
; --test-- "time protect 1"
; t: now/time protect 't
; --assert error? e: try [t/hour: 0]
; --assert e/id = 'locked-word
; --test-- "time protect 2"
; protect/words o: object [t: now/time]
; --assert error? e: try [o/t/hour: 0]
; --assert e/id = 'locked-word
; --test-- "time protect 3"
; o: object [t: 1 protect/words o: object [t: now/time]]
; --assert protected? 'o/o/t
; --assert protected? 'o/o/t/hour ;@@ <--- fails!
; --assert error? e: try [o/o/t/hour: 0] ;@@ <--- fails!
;===end-group===

~~~end-file~~~

0 comments on commit 54c0518

Please sign in to comment.