Fixing unit tests
parent
b18a463285
commit
8428f66933
|
@ -169,8 +169,10 @@ UNION: redefine-bug-2 redefine-bug-1 quotation ;
|
||||||
UNION: forget-class-bug-1 integer ;
|
UNION: forget-class-bug-1 integer ;
|
||||||
UNION: forget-class-bug-2 forget-class-bug-1 dll ;
|
UNION: forget-class-bug-2 forget-class-bug-1 dll ;
|
||||||
|
|
||||||
FORGET: forget-class-bug-1
|
[
|
||||||
FORGET: forget-class-bug-2
|
\ forget-class-bug-1 forget
|
||||||
|
\ forget-class-bug-2 forget
|
||||||
|
] with-compilation-unit
|
||||||
|
|
||||||
[ f ] [ forget-class-bug-1 typemap get values [ memq? ] with contains? ] unit-test
|
[ f ] [ forget-class-bug-1 typemap get values [ memq? ] with contains? ] unit-test
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ M: string my-hook "a string" ;
|
||||||
|
|
||||||
[ "an integer" ] [ 3 my-var set my-hook ] unit-test
|
[ "an integer" ] [ 3 my-var set my-hook ] unit-test
|
||||||
[ "a string" ] [ my-hook my-var set my-hook ] unit-test
|
[ "a string" ] [ my-hook my-var set my-hook ] unit-test
|
||||||
[ 1.0 my-var set my-hook ] [ [ T{ no-method f 1.0 my-hook } = ] must-fail-with
|
[ 1.0 my-var set my-hook ] [ T{ no-method f 1.0 my-hook } = ] must-fail-with
|
||||||
|
|
||||||
GENERIC: tag-and-f ( x -- x x )
|
GENERIC: tag-and-f ( x -- x x )
|
||||||
|
|
||||||
|
|
|
@ -326,10 +326,10 @@ DEFER: bar
|
||||||
: bad-bin ( a b -- ) 5 [ 5 bad-bin bad-bin 5 ] [ 2drop ] if ;
|
: bad-bin ( a b -- ) 5 [ 5 bad-bin bad-bin 5 ] [ 2drop ] if ;
|
||||||
[ [ bad-bin ] infer ] must-fail
|
[ [ bad-bin ] infer ] must-fail
|
||||||
|
|
||||||
[ [ [ r> ] infer ] [ inference-error? ] must-fail-with
|
[ [ r> ] infer ] [ inference-error? ] must-fail-with
|
||||||
|
|
||||||
! Regression
|
! Regression
|
||||||
[ [ [ get-slots ] infer ] [ inference-error? ] must-fail-with
|
[ [ get-slots ] infer ] [ inference-error? ] must-fail-with
|
||||||
|
|
||||||
! Test some curry stuff
|
! Test some curry stuff
|
||||||
{ 1 1 } [ 3 [ ] curry 4 [ ] curry if ] unit-test-effect
|
{ 1 1 } [ 3 [ ] curry 4 [ ] curry if ] unit-test-effect
|
||||||
|
|
|
@ -123,7 +123,7 @@ TUPLE: yo-momma ;
|
||||||
[ ] [ \ yo-momma forget ] unit-test
|
[ ] [ \ yo-momma forget ] unit-test
|
||||||
[ f ] [ \ yo-momma typemap get values memq? ] unit-test
|
[ f ] [ \ yo-momma typemap get values memq? ] unit-test
|
||||||
|
|
||||||
[ f ] [ \ yo-momma crossref ] unit-test
|
[ f ] [ \ yo-momma crossref get at ] unit-test
|
||||||
] with-compilation-unit
|
] with-compilation-unit
|
||||||
|
|
||||||
TUPLE: loc-recording ;
|
TUPLE: loc-recording ;
|
||||||
|
|
|
@ -63,14 +63,12 @@ IN: temporary
|
||||||
|
|
||||||
[ 2 ] [ "count-me" get-global ] unit-test
|
[ 2 ] [ "count-me" get-global ] unit-test
|
||||||
|
|
||||||
[ t ] [
|
|
||||||
[
|
[
|
||||||
"IN: vocabs.loader.test.a v-l-t-a-hello"
|
"IN: vocabs.loader.test.a v-l-t-a-hello"
|
||||||
<string-reader>
|
<string-reader>
|
||||||
"resource:core/vocabs/loader/test/a/a.factor"
|
"resource:core/vocabs/loader/test/a/a.factor"
|
||||||
parse-stream
|
parse-stream
|
||||||
] catch [ no-word? ] is?
|
] [ [ no-word? ] is? ] must-fail-with
|
||||||
] unit-test
|
|
||||||
|
|
||||||
0 "count-me" set-global
|
0 "count-me" set-global
|
||||||
|
|
||||||
|
@ -121,8 +119,7 @@ IN: temporary
|
||||||
[ "kernel" vocab where ] unit-test
|
[ "kernel" vocab where ] unit-test
|
||||||
|
|
||||||
[ t ] [
|
[ t ] [
|
||||||
[ "vocabs.loader.test.d" require ] catch
|
[ "vocabs.loader.test.d" require ] [ :1 ] recover
|
||||||
[ :1 ] when
|
|
||||||
"vocabs.loader.test.d" vocab-source-loaded?
|
"vocabs.loader.test.d" vocab-source-loaded?
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: combinators.lib kernel math math.ranges random sequences
|
USING: combinators.lib kernel math math.ranges random sequences
|
||||||
tools.test inference continuations arrays vectors ;
|
tools.test tools.test.inference continuations arrays vectors ;
|
||||||
IN: temporary
|
IN: temporary
|
||||||
|
|
||||||
[ 5 ] [ [ 10 random ] [ 5 = ] generate ] unit-test
|
[ 5 ] [ [ 10 random ] [ 5 = ] generate ] unit-test
|
||||||
|
|
|
@ -37,7 +37,7 @@ M: expected-error summary
|
||||||
: must-fail-with ( quot test -- )
|
: must-fail-with ( quot test -- )
|
||||||
>r [ expected-error construct-empty throw ] compose r>
|
>r [ expected-error construct-empty throw ] compose r>
|
||||||
[ recover ] 2curry
|
[ recover ] 2curry
|
||||||
[ ] swap unit-test ;
|
[ t ] swap unit-test ;
|
||||||
|
|
||||||
: must-fail ( quot -- )
|
: must-fail ( quot -- )
|
||||||
[ drop t ] must-fail-with ;
|
[ drop t ] must-fail-with ;
|
||||||
|
|
Loading…
Reference in New Issue