1 USING: documents documents.private accessors sequences
2 namespaces tools.test make arrays kernel fry ;
10 { 1 10 } [ , "HI" , ] each-line
17 { 1 11 } [ , "HI" , ] each-line
21 { { 1 "HI" 2 "HI" } } [
24 { 2 11 } [ , "HI" , ] each-line
28 { { { t f 1 } { t f 2 } } } [
32 '[ [ _ _ ] dip 3array , ] each-line
36 { { 10 4 } } [ { "a" } { 10 3 } text+loc ] unit-test
37 { { 10 4 } } [ { "a" } { 10 3 } text+loc ] unit-test
41 "Hello world,\nhow are you?\nMore text"
42 "doc" get set-doc-string
43 { 10 0 } "doc" get validate-loc
48 "Hello world,\nhow are you?\nMore text"
49 "doc" get set-doc-string
50 { 1 20 } "doc" get validate-loc
53 { " world,\nhow are you?\nMore" } [
55 "Hello world,\nhow are you?\nMore text"
56 "doc" get set-doc-string
57 { 0 5 } { 2 4 } "doc" get doc-range
60 { "Hello world,\nhow you?\nMore text" } [
62 "Hello world,\nhow are you?\nMore text"
63 "doc" get set-doc-string
64 { 1 3 } { 1 7 } "doc" get remove-doc-range
68 { "Hello world,\nhow text" } [
70 "Hello world,\nhow are you?\nMore text"
71 "doc" get set-doc-string
72 { 1 3 } { 2 4 } "doc" get remove-doc-range
76 { "Hello world,\nhow you?\nMore text" } [
78 "Hello world,\nhow are you?\nMore text"
79 "doc" get set-doc-string
80 "" { 1 3 } { 1 7 } "doc" get set-doc-range
84 { "Hello world,\nhow text" } [
86 "Hello world,\nhow are you?\nMore text"
87 "doc" get set-doc-string
88 "" { 1 3 } { 2 4 } "doc" get set-doc-range
93 "Hello\nworld, how are\nyou?" "doc" get set-doc-string
95 { { 2 4 } } [ "doc" get doc-end ] unit-test
98 { } [ <document> "d" set ] unit-test
100 { } [ "Hello, world." "d" get set-doc-string ] unit-test
105 { new-string "Hello, world." }
110 } [ "d" get undos>> first ] unit-test
112 { } [ "Goodbye" { 0 0 } { 0 5 } "d" get set-doc-range ] unit-test
114 { "Goodbye, world." } [ "d" get doc-string ] unit-test
116 { } [ "cruel " { 0 9 } { 0 9 } "d" get set-doc-range ] unit-test
118 { 3 } [ "d" get undos>> length ] unit-test
120 { "Goodbye, cruel world." } [ "d" get doc-string ] unit-test
122 { "" { 0 9 } { 0 15 } } [
124 [ old-string>> ] [ from>> ] [ new-to>> ] tri
127 { } [ "d" get undo ] unit-test
129 { "Goodbye, world." } [ "d" get doc-string ] unit-test
131 { } [ "d" get undo ] unit-test
133 { "Hello, world." } [ "d" get doc-string ] unit-test
135 { } [ "d" get redo ] unit-test
137 { "Goodbye, world." } [ "d" get doc-string ] unit-test
139 { } [ <document> "d" set ] unit-test
141 { } [ "d" get clear-doc ] unit-test
143 { } [ "d" get clear-doc ] unit-test
145 { 0 } [ "d" get undos>> length ] unit-test
147 { } [ <document> "d" set ] unit-test
149 { } [ "d" get value>> "value" set ] unit-test
151 { } [ "Hello world" "d" get set-doc-string ] unit-test
153 { { "" } } [ "value" get ] unit-test