If a vocab fails to load, manifest would be left in a weird state (reported by Joe Groff)
parent
4b2a2a9d0a
commit
9cc178b738
|
@ -618,4 +618,13 @@ EXCLUDE: qualified.tests.bar => x ;
|
|||
|
||||
[
|
||||
"USE: kernel UNUSE: kernel dup" <string-reader> "unuse-test" parse-stream
|
||||
] [ error>> error>> error>> no-word-error? ] must-fail-with
|
||||
] [ error>> error>> error>> no-word-error? ] must-fail-with
|
||||
|
||||
[ ] [ [ "vocabs.loader.test.l" forget-vocab ] with-compilation-unit ] unit-test
|
||||
|
||||
[
|
||||
[ "vocabs.loader.test.l" use-vocab ] must-fail
|
||||
[ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> key? ] unit-test
|
||||
[ ] [ "vocabs.loader.test.l" unuse-vocab ] unit-test
|
||||
[ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> key? ] unit-test
|
||||
] with-file-vocabs
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
IN: vocabs.loader.test.l
|
||||
USE: kernel
|
||||
|
||||
"Oops" throw
|
|
@ -0,0 +1 @@
|
|||
unportable
|
|
@ -108,8 +108,8 @@ TUPLE: no-current-vocab ;
|
|||
dup using-vocab?
|
||||
[ vocab-name "Already using ``" "'' vocabulary" surround note. ] [
|
||||
manifest get
|
||||
[ [ vocab-name ] dip search-vocab-names>> conjoin ]
|
||||
[ [ load-vocab ] dip search-vocabs>> push ]
|
||||
[ [ vocab-name ] dip search-vocab-names>> conjoin ]
|
||||
2bi
|
||||
] if ;
|
||||
|
||||
|
@ -121,8 +121,8 @@ TUPLE: no-current-vocab ;
|
|||
: unuse-vocab ( vocab -- )
|
||||
dup using-vocab? [
|
||||
manifest get
|
||||
[ [ vocab-name ] dip search-vocab-names>> delete-at ]
|
||||
[ [ load-vocab ] dip search-vocabs>> delq ]
|
||||
[ [ vocab-name ] dip search-vocab-names>> delete-at ]
|
||||
2bi
|
||||
] [ drop ] if ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue