new accessors

db4
Doug Coleman 2008-09-02 01:55:36 -05:00
parent 457dbc33d0
commit 76fb3de616
3 changed files with 12 additions and 13 deletions

View File

@ -28,7 +28,7 @@ TUPLE: dummy-destructor obj ;
C: <dummy-destructor> dummy-destructor C: <dummy-destructor> dummy-destructor
M: dummy-destructor dispose ( obj -- ) M: dummy-destructor dispose ( obj -- )
dummy-destructor-obj t swap set-dummy-obj-destroyed? ; obj>> t >>destroyed? drop ;
: destroy-always : destroy-always
<dummy-destructor> &dispose drop ; <dummy-destructor> &dispose drop ;
@ -39,13 +39,13 @@ M: dummy-destructor dispose ( obj -- )
[ t ] [ [ t ] [
[ [
<dummy-obj> dup destroy-always <dummy-obj> dup destroy-always
] with-destructors dummy-obj-destroyed? ] with-destructors destroyed?>>
] unit-test ] unit-test
[ f ] [ [ f ] [
[ [
<dummy-obj> dup destroy-later <dummy-obj> dup destroy-later
] with-destructors dummy-obj-destroyed? ] with-destructors destroyed?>>
] unit-test ] unit-test
[ t ] [ [ t ] [
@ -54,7 +54,7 @@ M: dummy-destructor dispose ( obj -- )
dup destroy-always dup destroy-always
"foo" throw "foo" throw
] with-destructors ] with-destructors
] ignore-errors dummy-obj-destroyed? ] ignore-errors destroyed?>>
] unit-test ] unit-test
[ t ] [ [ t ] [
@ -63,6 +63,6 @@ M: dummy-destructor dispose ( obj -- )
dup destroy-later dup destroy-later
"foo" throw "foo" throw
] with-destructors ] with-destructors
] ignore-errors dummy-obj-destroyed? ] ignore-errors destroyed?>>
] unit-test ] unit-test

View File

@ -3,7 +3,6 @@ io.streams.string namespaces classes effects source-files
assocs sequences strings io.files definitions continuations assocs sequences strings io.files definitions continuations
sorting classes.tuple compiler.units debugger vocabs sorting classes.tuple compiler.units debugger vocabs
vocabs.loader accessors eval combinators ; vocabs.loader accessors eval combinators ;
IN: parser.tests IN: parser.tests
[ [
@ -63,7 +62,7 @@ IN: parser.tests
: baz ( a b -- * ) 2array throw ; : baz ( a b -- * ) 2array throw ;
[ t ] [ t ]
[ \ baz "declared-effect" word-prop effect-terminated? ] [ \ baz "declared-effect" word-prop terminated?>> ]
unit-test unit-test
[ ] [ "IN: parser.tests USE: math : effect-parsing-test ( a b -- d ) - ;" eval ] 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" "IN: parser.tests : smudge-me ;" <string-reader> "foo"
parse-stream drop parse-stream drop
"foo" source-file source-file-definitions first assoc-size "foo" source-file definitions>> first assoc-size
] unit-test ] unit-test
[ t ] [ "smudge-me" "parser.tests" lookup >boolean ] 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" "IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
parse-stream drop parse-stream drop
"foo" source-file source-file-definitions first assoc-size "foo" source-file definitions>> first assoc-size
] unit-test ] unit-test
[ 1 ] [ [ 1 ] [
"IN: parser.tests USING: arrays ; M: array smudge-me ;" <string-reader> "bar" "IN: parser.tests USING: arrays ; M: array smudge-me ;" <string-reader> "bar"
parse-stream drop parse-stream drop
"bar" source-file source-file-definitions first assoc-size "bar" source-file definitions>> first assoc-size
] unit-test ] unit-test
[ 2 ] [ [ 2 ] [
"IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ;" <string-reader> "foo" "IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ;" <string-reader> "foo"
parse-stream drop parse-stream drop
"foo" source-file source-file-definitions first assoc-size "foo" source-file definitions>> first assoc-size
] unit-test ] unit-test
[ t ] [ [ t ] [
@ -401,7 +400,7 @@ IN: parser.tests
] times ] times
[ "resource:core/parser/test/assert-depth.factor" run-file ] [ "resource:core/parser/test/assert-depth.factor" run-file ]
[ relative-overflow-stack { 1 2 3 } sequence= ] [ stack>> { 1 2 3 } sequence= ]
must-fail-with must-fail-with
2 [ 2 [

View File

@ -55,7 +55,7 @@ IN: vocabs.loader.tests
[ t ] [ [ t ] [
"resource:core/vocabs/loader/test/a/a.factor" "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 . "v-l-t-a-hello" "vocabs.loader.test.a" lookup dup .
swap first key? swap first key?
] unit-test ] unit-test