Unit test fixes
parent
af41a0efe7
commit
64b06f059a
|
@ -1,5 +1,6 @@
|
||||||
IN: temporary
|
IN: temporary
|
||||||
USING: bootstrap.image tools.test.infer ;
|
USING: bootstrap.image bootstrap.image.private
|
||||||
|
tools.test.inference ;
|
||||||
|
|
||||||
\ ' must-infer
|
\ ' must-infer
|
||||||
\ write-image must-infer
|
\ write-image must-infer
|
||||||
|
|
|
@ -62,7 +62,7 @@ UNION: bah fixnum alien ;
|
||||||
[ bah ] [ \ bah? "predicating" word-prop ] unit-test
|
[ bah ] [ \ bah? "predicating" word-prop ] unit-test
|
||||||
|
|
||||||
! Test generic see and parsing
|
! Test generic see and parsing
|
||||||
[ "IN: temporary\nSYMBOL: bah\n\nUNION: bah fixnum alien ;\n" ]
|
[ "USING: alien math ;\nIN: temporary\nUNION: bah fixnum alien ;\n" ]
|
||||||
[ [ \ bah see ] string-out ] unit-test
|
[ [ \ bah see ] string-out ] unit-test
|
||||||
|
|
||||||
! Test redefinition of classes
|
! Test redefinition of classes
|
||||||
|
|
|
@ -120,8 +120,6 @@ TUPLE: delegating ;
|
||||||
|
|
||||||
[ t ] [ \ + math-generic? ] unit-test
|
[ t ] [ \ + math-generic? ] unit-test
|
||||||
|
|
||||||
[ "SYMBOL: not-a-class C: not-a-class ;" eval ] unit-test-fails
|
|
||||||
|
|
||||||
! Test math-combination
|
! Test math-combination
|
||||||
[ [ [ >float ] dip ] ] [ \ real \ float math-upgrade ] unit-test
|
[ [ [ >float ] dip ] ] [ \ real \ float math-upgrade ] unit-test
|
||||||
[ [ >float ] ] [ \ float \ real math-upgrade ] unit-test
|
[ [ >float ] ] [ \ float \ real math-upgrade ] unit-test
|
||||||
|
|
|
@ -3,7 +3,7 @@ USING: arrays math.private kernel math compiler inference
|
||||||
inference.dataflow optimizer tools.test kernel.private generic
|
inference.dataflow optimizer tools.test kernel.private generic
|
||||||
sequences words inference.class quotations alien
|
sequences words inference.class quotations alien
|
||||||
alien.c-types strings sbufs sequences.private
|
alien.c-types strings sbufs sequences.private
|
||||||
slots.private combinators ;
|
slots.private combinators definitions ;
|
||||||
|
|
||||||
! Make sure these compile even though this is invalid code
|
! Make sure these compile even though this is invalid code
|
||||||
[ ] [ [ 10 mod 3.0 /i ] dataflow optimize drop ] unit-test
|
[ ] [ [ 10 mod 3.0 /i ] dataflow optimize drop ] unit-test
|
||||||
|
|
|
@ -265,8 +265,9 @@ M: staging-violation summary
|
||||||
"A parsing word cannot be used in the same file it is defined in." ;
|
"A parsing word cannot be used in the same file it is defined in." ;
|
||||||
|
|
||||||
: execute-parsing ( word -- )
|
: execute-parsing ( word -- )
|
||||||
dup
|
new-definitions get [
|
||||||
new-definitions get first key? [ staging-violation ] when
|
dupd first key? [ staging-violation ] when
|
||||||
|
] when*
|
||||||
execute ;
|
execute ;
|
||||||
|
|
||||||
: parse-step ( accum end -- accum ? )
|
: parse-step ( accum end -- accum ? )
|
||||||
|
@ -300,6 +301,9 @@ SYMBOL: lexer-factory
|
||||||
: parse-lines ( lines -- quot )
|
: parse-lines ( lines -- quot )
|
||||||
lexer-factory get call (parse-lines) ;
|
lexer-factory get call (parse-lines) ;
|
||||||
|
|
||||||
|
: parse ( str -- quot )
|
||||||
|
[ string-lines parse-lines ] with-compilation-unit ;
|
||||||
|
|
||||||
! Parsing word utilities
|
! Parsing word utilities
|
||||||
: parse-effect ( -- effect )
|
: parse-effect ( -- effect )
|
||||||
")" parse-tokens { "--" } split1 dup [
|
")" parse-tokens { "--" } split1 dup [
|
||||||
|
@ -421,7 +425,9 @@ SYMBOL: bootstrap-syntax
|
||||||
file get source-file-path =
|
file get source-file-path =
|
||||||
] assoc-subset ;
|
] assoc-subset ;
|
||||||
|
|
||||||
: removed-definitions ( -- definitions ) new-definitions get old-definitions get [ first2 union ] 2apply diff ;
|
: removed-definitions ( -- definitions )
|
||||||
|
new-definitions old-definitions
|
||||||
|
[ get first2 union ] 2apply diff ;
|
||||||
|
|
||||||
: smudged-usage ( -- usages referenced removed )
|
: smudged-usage ( -- usages referenced removed )
|
||||||
removed-definitions filter-moved keys [
|
removed-definitions filter-moved keys [
|
||||||
|
|
|
@ -256,7 +256,7 @@ M: builtin-class see-class*
|
||||||
|
|
||||||
: see-class ( class -- )
|
: see-class ( class -- )
|
||||||
dup class? [
|
dup class? [
|
||||||
nl [ dup see-class* ] with-pprint nl
|
dup seeing-word dup see-class*
|
||||||
] when drop ;
|
] when drop ;
|
||||||
|
|
||||||
: see-methods ( generic -- seq )
|
: see-methods ( generic -- seq )
|
||||||
|
@ -265,7 +265,7 @@ M: builtin-class see-class*
|
||||||
|
|
||||||
M: word see
|
M: word see
|
||||||
[
|
[
|
||||||
dup see-class*
|
dup see-class
|
||||||
dup class? over symbol? and not [ dup (see) ] when
|
dup class? over symbol? and not [ dup (see) ] when
|
||||||
] with-use nl
|
] with-use nl
|
||||||
[
|
[
|
||||||
|
|
|
@ -233,3 +233,9 @@ C: <erg's-reshape-problem> erg's-reshape-problem
|
||||||
[ t ] [ cons-test-1 array-capacity "a" get array-capacity = ] unit-test
|
[ t ] [ cons-test-1 array-capacity "a" get array-capacity = ] unit-test
|
||||||
|
|
||||||
[ t ] [ 1 cons-test-3 array-capacity "a" get array-capacity = ] unit-test
|
[ t ] [ 1 cons-test-3 array-capacity "a" get array-capacity = ] unit-test
|
||||||
|
|
||||||
|
[ t ] [
|
||||||
|
[
|
||||||
|
"IN: temporary SYMBOL: not-a-class C: <not-a-class> not-a-class" eval
|
||||||
|
] catch [ check-tuple? ] is?
|
||||||
|
] unit-test
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
USING: math definitions help.topics help tools.test
|
USING: math definitions help.topics help tools.test
|
||||||
prettyprint parser io.streams.string kernel source-files
|
prettyprint parser io.streams.string kernel source-files
|
||||||
assocs namespaces words io ;
|
assocs namespaces words io sequences ;
|
||||||
IN: temporary
|
IN: temporary
|
||||||
|
|
||||||
[ ] [ \ + >link see ] unit-test
|
[ ] [ \ + >link see ] unit-test
|
||||||
|
|
||||||
[
|
[
|
||||||
file-vocabs
|
|
||||||
|
|
||||||
[ 4 ] [
|
[ 4 ] [
|
||||||
"IN: temporary USING: help.syntax ; : hello ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
|
"IN: temporary USING: help.syntax ; : hello ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
|
||||||
parse-stream drop
|
parse-stream drop
|
||||||
|
@ -34,9 +32,9 @@ IN: temporary
|
||||||
"hello" "temporary" lookup "help" word-prop
|
"hello" "temporary" lookup "help" word-prop
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ [ ] ] [ "IN: temporary USING: help.syntax ; : xxx ; HELP: xxx ;" parse ] unit-test
|
[ ] [ "IN: temporary USING: help.syntax ; : xxx ; HELP: xxx ;" eval ] unit-test
|
||||||
|
|
||||||
[ ] [ "xxx" "temporary" lookup help ] unit-test
|
[ ] [ "xxx" "temporary" lookup help ] unit-test
|
||||||
|
|
||||||
[ ] [ "xxx" "temporary" lookup >link synopsis print ] unit-test
|
[ ] [ "xxx" "temporary" lookup >link synopsis print ] unit-test
|
||||||
] with-scope
|
] with-file-vocabs
|
||||||
|
|
|
@ -16,8 +16,6 @@ M: link forget link-name remove-article ;
|
||||||
|
|
||||||
M: link definition article-content ;
|
M: link definition article-content ;
|
||||||
|
|
||||||
M: link see (see) ;
|
|
||||||
|
|
||||||
M: link synopsis*
|
M: link synopsis*
|
||||||
\ ARTICLE: pprint-word
|
\ ARTICLE: pprint-word
|
||||||
dup link-name pprint*
|
dup link-name pprint*
|
||||||
|
|
|
@ -2,8 +2,6 @@ IN: temporary
|
||||||
USING: tools.test parser vocabs help.syntax namespaces ;
|
USING: tools.test parser vocabs help.syntax namespaces ;
|
||||||
|
|
||||||
[
|
[
|
||||||
file-vocabs
|
|
||||||
|
|
||||||
[ "foobar" ] [
|
[ "foobar" ] [
|
||||||
"IN: temporary USE: help.syntax ABOUT: \"foobar\"" eval
|
"IN: temporary USE: help.syntax ABOUT: \"foobar\"" eval
|
||||||
"temporary" vocab vocab-help
|
"temporary" vocab vocab-help
|
||||||
|
@ -20,4 +18,4 @@ USING: tools.test parser vocabs help.syntax namespaces ;
|
||||||
"IN: temporary USE: help.syntax ABOUT: xyz" eval
|
"IN: temporary USE: help.syntax ABOUT: xyz" eval
|
||||||
"temporary" vocab vocab-help
|
"temporary" vocab vocab-help
|
||||||
] unit-test
|
] unit-test
|
||||||
] with-scope
|
] with-file-vocabs
|
||||||
|
|
|
@ -306,5 +306,3 @@ $nl
|
||||||
{ $subsection control-value }
|
{ $subsection control-value }
|
||||||
{ $subsection set-control-value }
|
{ $subsection set-control-value }
|
||||||
{ $see-also "models" } ;
|
{ $see-also "models" } ;
|
||||||
|
|
||||||
ABOUT: "ui-control-impl"
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ M: interactor stream-read-partial
|
||||||
: try-parse ( str interactor -- quot/error/f )
|
: try-parse ( str interactor -- quot/error/f )
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
[ restore-vars [ parse ] with-compilation-unit ] keep save-vars
|
[ restore-vars parse ] keep save-vars
|
||||||
] [
|
] [
|
||||||
>r f swap set-interactor-busy? drop r>
|
>r f swap set-interactor-busy? drop r>
|
||||||
dup delegate unexpected-eof? [ drop f ] when
|
dup delegate unexpected-eof? [ drop f ] when
|
||||||
|
|
|
@ -34,7 +34,7 @@ f <workspace> dup [
|
||||||
workspace-listener
|
workspace-listener
|
||||||
listener-gadget-input
|
listener-gadget-input
|
||||||
"ok" on
|
"ok" on
|
||||||
parse-interactive
|
stream-read-quot
|
||||||
"c" get continue-with
|
"c" get continue-with
|
||||||
] in-thread drop
|
] in-thread drop
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue