]> gitweb.factorcode.org Git - factor.git/commitdiff
If a vocab fails to load, manifest would be left in a weird state (reported by Joe...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 22 May 2009 06:59:50 +0000 (01:59 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 22 May 2009 06:59:50 +0000 (01:59 -0500)
core/parser/parser-tests.factor
core/vocabs/loader/test/l/l.factor [new file with mode: 0644]
core/vocabs/loader/test/l/tags.txt [new file with mode: 0644]
core/vocabs/parser/parser.factor

index a9e0bd08abff874a95767251f3560a6cc9653155..32f432a6cdd5efd228e85b6f7cbd8a05691681aa 100644 (file)
@@ -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
\ No newline at end of file
+] [ 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
diff --git a/core/vocabs/loader/test/l/l.factor b/core/vocabs/loader/test/l/l.factor
new file mode 100644 (file)
index 0000000..10cd35d
--- /dev/null
@@ -0,0 +1,4 @@
+IN: vocabs.loader.test.l
+USE: kernel
+
+"Oops" throw
\ No newline at end of file
diff --git a/core/vocabs/loader/test/l/tags.txt b/core/vocabs/loader/test/l/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
index 45084ae8ffb20da295ab49013ad68b25fde439fd..ff55f8e68d67067b8081bfe45c2031d0587538f4 100644 (file)
@@ -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 ;