If a vocab fails to load, manifest would be left in a weird state (reported by Joe Groff)
parent
661e2a0994
commit
10f86331b4
|
@ -619,3 +619,12 @@ EXCLUDE: qualified.tests.bar => x ;
|
||||||
[
|
[
|
||||||
"USE: kernel UNUSE: kernel dup" <string-reader> "unuse-test" parse-stream
|
"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?
|
dup using-vocab?
|
||||||
[ vocab-name "Already using ``" "'' vocabulary" surround note. ] [
|
[ vocab-name "Already using ``" "'' vocabulary" surround note. ] [
|
||||||
manifest get
|
manifest get
|
||||||
[ [ vocab-name ] dip search-vocab-names>> conjoin ]
|
|
||||||
[ [ load-vocab ] dip search-vocabs>> push ]
|
[ [ load-vocab ] dip search-vocabs>> push ]
|
||||||
|
[ [ vocab-name ] dip search-vocab-names>> conjoin ]
|
||||||
2bi
|
2bi
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
|
@ -121,8 +121,8 @@ TUPLE: no-current-vocab ;
|
||||||
: unuse-vocab ( vocab -- )
|
: unuse-vocab ( vocab -- )
|
||||||
dup using-vocab? [
|
dup using-vocab? [
|
||||||
manifest get
|
manifest get
|
||||||
[ [ vocab-name ] dip search-vocab-names>> delete-at ]
|
|
||||||
[ [ load-vocab ] dip search-vocabs>> delq ]
|
[ [ load-vocab ] dip search-vocabs>> delq ]
|
||||||
|
[ [ vocab-name ] dip search-vocab-names>> delete-at ]
|
||||||
2bi
|
2bi
|
||||||
] [ drop ] if ;
|
] [ drop ] if ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue