1 USING: documents documents.private accessors sequences
2 namespaces tools.test make arrays kernel fry ;
9 { 1 10 } [ , "HI" , ] each-doc-line
16 { 1 11 } [ , "HI" , ] each-doc-line
20 { { 1 "HI" 2 "HI" } } [
23 { 2 11 } [ , "HI" , ] each-doc-line
27 { { { t f 1 } { t f 2 } } } [
31 '[ [ _ _ ] dip 3array , ] each-doc-line
35 { { 10 4 } } [ { "a" } { 10 3 } text+loc ] unit-test
36 { { 10 4 } } [ { "a" } { 10 3 } text+loc ] unit-test
40 "Hello world,\nhow are you?\nMore text"
41 "doc" get set-doc-string
42 { 10 0 } "doc" get validate-loc
47 "Hello world,\nhow are you?\nMore text"
48 "doc" get set-doc-string
49 { 1 20 } "doc" get validate-loc
52 { " world,\nhow are you?\nMore" } [
54 "Hello world,\nhow are you?\nMore text"
55 "doc" get set-doc-string
56 { 0 5 } { 2 4 } "doc" get doc-range
59 { "Hello world,\nhow you?\nMore text" } [
61 "Hello world,\nhow are you?\nMore text"
62 "doc" get set-doc-string
63 { 1 3 } { 1 7 } "doc" get remove-doc-range
67 { "Hello world,\nhow text" } [
69 "Hello world,\nhow are you?\nMore text"
70 "doc" get set-doc-string
71 { 1 3 } { 2 4 } "doc" get remove-doc-range
75 { "Hello world,\nhow you?\nMore text" } [
77 "Hello world,\nhow are you?\nMore text"
78 "doc" get set-doc-string
79 "" { 1 3 } { 1 7 } "doc" get set-doc-range
83 { "Hello world,\nhow text" } [
85 "Hello world,\nhow are you?\nMore text"
86 "doc" get set-doc-string
87 "" { 1 3 } { 2 4 } "doc" get set-doc-range
92 "Hello\nworld, how are\nyou?" "doc" get set-doc-string
94 { { 2 4 } } [ "doc" get doc-end ] unit-test
97 { } [ <document> "d" set ] unit-test
99 { } [ "Hello, world." "d" get set-doc-string ] unit-test
104 { new-string "Hello, world." }
109 } [ "d" get undos>> first ] unit-test
111 { } [ "Goodbye" { 0 0 } { 0 5 } "d" get set-doc-range ] unit-test
113 { "Goodbye, world." } [ "d" get doc-string ] unit-test
115 { } [ "cruel " { 0 9 } { 0 9 } "d" get set-doc-range ] unit-test
117 { 3 } [ "d" get undos>> length ] unit-test
119 { "Goodbye, cruel world." } [ "d" get doc-string ] unit-test
121 { "" { 0 9 } { 0 15 } } [
123 [ old-string>> ] [ from>> ] [ new-to>> ] tri
126 { } [ "d" get undo ] unit-test
128 { "Goodbye, world." } [ "d" get doc-string ] unit-test
130 { } [ "d" get undo ] unit-test
132 { "Hello, world." } [ "d" get doc-string ] unit-test
134 { } [ "d" get redo ] unit-test
136 { "Goodbye, world." } [ "d" get doc-string ] unit-test
138 { } [ <document> "d" set ] unit-test
140 { } [ "d" get clear-doc ] unit-test
142 { } [ "d" get clear-doc ] unit-test
144 { 0 } [ "d" get undos>> length ] unit-test
146 { } [ <document> "d" set ] unit-test
148 { } [ "d" get value>> "value" set ] unit-test
150 { } [ "Hello world" "d" get set-doc-string ] unit-test
152 { { "" } } [ "value" get ] unit-test