]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/documents/documents-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / documents / documents-tests.factor
index a044a2d2552bc6ae603574b86389ca201dd8b767..41d93c889ec4acf9c5f32b56f85f4a7f53337014 100644 (file)
@@ -1,6 +1,6 @@
-IN: documents.tests
 USING: documents documents.private accessors sequences
 namespaces tools.test make arrays kernel fry ;
+IN: documents.tests
 
 ! Tests
 
@@ -89,6 +89,11 @@ namespaces tools.test make arrays kernel fry ;
     "doc" get doc-string
 ] unit-test
 
+<document> "doc" set
+"Hello\nworld, how are\nyou?" "doc" get set-doc-string
+
+[ { 2 4 } ] [ "doc" get doc-end ] unit-test
+
 ! Undo/redo
 [ ] [ <document> "d" set ] unit-test
 
@@ -115,7 +120,7 @@ namespaces tools.test make arrays kernel fry ;
 [ "Goodbye, cruel world." ] [ "d" get doc-string ] unit-test
 
 [ "" { 0 9 } { 0 15 } ] [
-    "d" get undos>> peek
+    "d" get undos>> last
     [ old-string>> ] [ from>> ] [ new-to>> ] tri
 ] unit-test
 
@@ -130,3 +135,19 @@ namespaces tools.test make arrays kernel fry ;
 [ ] [ "d" get redo ] unit-test
 
 [ "Goodbye, world." ] [ "d" get doc-string ] unit-test
+
+[ ] [ <document> "d" set ] unit-test
+
+[ ] [ "d" get clear-doc ] unit-test
+
+[ ] [ "d" get clear-doc ] unit-test
+
+[ 0 ] [ "d" get undos>> length ] unit-test
+
+[ ] [ <document> "d" set ] unit-test
+
+[ ] [ "d" get value>> "value" set ] unit-test
+
+[ ] [ "Hello world" "d" get set-doc-string ] unit-test
+
+[ { "" } ] [ "value" get ] unit-test