new accessors
parent
457dbc33d0
commit
76fb3de616
|
@ -28,7 +28,7 @@ TUPLE: dummy-destructor obj ;
|
|||
C: <dummy-destructor> dummy-destructor
|
||||
|
||||
M: dummy-destructor dispose ( obj -- )
|
||||
dummy-destructor-obj t swap set-dummy-obj-destroyed? ;
|
||||
obj>> t >>destroyed? drop ;
|
||||
|
||||
: destroy-always
|
||||
<dummy-destructor> &dispose drop ;
|
||||
|
@ -39,13 +39,13 @@ M: dummy-destructor dispose ( obj -- )
|
|||
[ t ] [
|
||||
[
|
||||
<dummy-obj> dup destroy-always
|
||||
] with-destructors dummy-obj-destroyed?
|
||||
] with-destructors destroyed?>>
|
||||
] unit-test
|
||||
|
||||
[ f ] [
|
||||
[
|
||||
<dummy-obj> dup destroy-later
|
||||
] with-destructors dummy-obj-destroyed?
|
||||
] with-destructors destroyed?>>
|
||||
] unit-test
|
||||
|
||||
[ t ] [
|
||||
|
@ -54,7 +54,7 @@ M: dummy-destructor dispose ( obj -- )
|
|||
dup destroy-always
|
||||
"foo" throw
|
||||
] with-destructors
|
||||
] ignore-errors dummy-obj-destroyed?
|
||||
] ignore-errors destroyed?>>
|
||||
] unit-test
|
||||
|
||||
[ t ] [
|
||||
|
@ -63,6 +63,6 @@ M: dummy-destructor dispose ( obj -- )
|
|||
dup destroy-later
|
||||
"foo" throw
|
||||
] with-destructors
|
||||
] ignore-errors dummy-obj-destroyed?
|
||||
] ignore-errors destroyed?>>
|
||||
] unit-test
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ io.streams.string namespaces classes effects source-files
|
|||
assocs sequences strings io.files definitions continuations
|
||||
sorting classes.tuple compiler.units debugger vocabs
|
||||
vocabs.loader accessors eval combinators ;
|
||||
|
||||
IN: parser.tests
|
||||
|
||||
[
|
||||
|
@ -63,7 +62,7 @@ IN: parser.tests
|
|||
: baz ( a b -- * ) 2array throw ;
|
||||
|
||||
[ t ]
|
||||
[ \ baz "declared-effect" word-prop effect-terminated? ]
|
||||
[ \ baz "declared-effect" word-prop terminated?>> ]
|
||||
unit-test
|
||||
|
||||
[ ] [ "IN: parser.tests USE: math : effect-parsing-test ( a b -- d ) - ;" eval ] unit-test
|
||||
|
@ -121,7 +120,7 @@ IN: parser.tests
|
|||
"IN: parser.tests : smudge-me ;" <string-reader> "foo"
|
||||
parse-stream drop
|
||||
|
||||
"foo" source-file source-file-definitions first assoc-size
|
||||
"foo" source-file definitions>> first assoc-size
|
||||
] unit-test
|
||||
|
||||
[ t ] [ "smudge-me" "parser.tests" lookup >boolean ] unit-test
|
||||
|
@ -138,21 +137,21 @@ IN: parser.tests
|
|||
"IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
|
||||
parse-stream drop
|
||||
|
||||
"foo" source-file source-file-definitions first assoc-size
|
||||
"foo" source-file definitions>> first assoc-size
|
||||
] unit-test
|
||||
|
||||
[ 1 ] [
|
||||
"IN: parser.tests USING: arrays ; M: array smudge-me ;" <string-reader> "bar"
|
||||
parse-stream drop
|
||||
|
||||
"bar" source-file source-file-definitions first assoc-size
|
||||
"bar" source-file definitions>> first assoc-size
|
||||
] unit-test
|
||||
|
||||
[ 2 ] [
|
||||
"IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ;" <string-reader> "foo"
|
||||
parse-stream drop
|
||||
|
||||
"foo" source-file source-file-definitions first assoc-size
|
||||
"foo" source-file definitions>> first assoc-size
|
||||
] unit-test
|
||||
|
||||
[ t ] [
|
||||
|
@ -401,7 +400,7 @@ IN: parser.tests
|
|||
] times
|
||||
|
||||
[ "resource:core/parser/test/assert-depth.factor" run-file ]
|
||||
[ relative-overflow-stack { 1 2 3 } sequence= ]
|
||||
[ stack>> { 1 2 3 } sequence= ]
|
||||
must-fail-with
|
||||
|
||||
2 [
|
||||
|
|
|
@ -55,7 +55,7 @@ IN: vocabs.loader.tests
|
|||
|
||||
[ t ] [
|
||||
"resource:core/vocabs/loader/test/a/a.factor"
|
||||
source-file source-file-definitions dup USE: prettyprint .
|
||||
source-file definitions>> dup USE: prettyprint .
|
||||
"v-l-t-a-hello" "vocabs.loader.test.a" lookup dup .
|
||||
swap first key?
|
||||
] unit-test
|
||||
|
|
Loading…
Reference in New Issue