@@ -27,31 +27,31 @@ test-recursive:
2727
2828 content := "foobar" .to-byte-array
2929 other-content := "gee" .to-byte-array
30- file .write-content --path = tmp-file content
30+ file .write-contents --path = tmp-file content
3131
3232 // Copy absolute path to absolute target path.
3333 file2 := "$ tmp-dir /file2.txt"
3434 file .copy --source = tmp-file --target = file2
35- expect-equals content ( file .read-content file2 )
35+ expect-equals content ( file .read-contents file2 )
3636
3737 // Copy of relative file to relative directory path.
3838 directory .mkdir "subdir2"
3939 file .copy --source = "file.txt" --target = "subdir2/file.txt"
40- expect-equals content ( file .read-content "subdir2/file.txt" )
41- expect-equals content ( file .read-content "$ tmp-dir /subdir2/file.txt" )
40+ expect-equals content ( file .read-contents "subdir2/file.txt" )
41+ expect-equals content ( file .read-contents "$ tmp-dir /subdir2/file.txt" )
4242
4343 // Copy recursive.
4444 directory .mkdir "subdir2/nested-subdir"
45- file .write-content --path = "subdir2/nested-subdir/other.txt" other-content
45+ file .write-contents --path = "subdir2/nested-subdir/other.txt" other-content
4646 file .copy --source = "subdir2" --target = "subdir3" --recursive
47- expect-equals content ( file .read-content "subdir3/file.txt" )
48- expect-equals other-content ( file .read-content "subdir3/nested-subdir/other.txt" )
47+ expect-equals content ( file .read-contents "subdir3/file.txt" )
48+ expect-equals other-content ( file .read-contents "subdir3/nested-subdir/other.txt" )
4949
5050 // Copy recursive to existing directory.
5151 directory .mkdir "subdir4"
5252 file .copy --source = "subdir3" --target = "subdir4" --recursive
53- expect-equals content ( file .read-content "subdir4/file.txt" )
54- expect-equals other-content ( file .read-content "subdir4/nested-subdir/other.txt" )
53+ expect-equals content ( file .read-contents "subdir4/file.txt" )
54+ expect-equals other-content ( file .read-contents "subdir4/nested-subdir/other.txt" )
5555
5656test-permissions :
5757 file-permission0 / int := ?
@@ -73,7 +73,7 @@ test-permissions:
7373
7474 with-tmp-dir : | tmp-dir |
7575 file1 := "$ tmp-dir /file1.txt"
76- file .write-content --path = file1 "foobar"
76+ file .write-contents --path = file1 "foobar"
7777
7878 file .chmod file1 file-permission0
7979 file .copy --source = file1 --target = "$ tmp-dir /file2.txt"
@@ -87,31 +87,31 @@ test-permissions:
8787 directory .mkdir dir
8888
8989 file-in-dir := "$ tmp-dir /dir/file.txt"
90- file .write-content --path = file-in-dir "gee"
90+ file .write-contents --path = file-in-dir "gee"
9191
9292 file .chmod dir dir-permission
9393 file .copy --source = dir --target = "$ tmp-dir /dir2" --recursive
9494 expect-equals dir-permission ( file .stat "$ tmp-dir /dir2" ) [ file .ST-MODE ]
95- expect-equals "gee" .to-byte-array ( file .read-content "$ tmp-dir /dir2/file.txt" )
95+ expect-equals "gee" .to-byte-array ( file .read-contents "$ tmp-dir /dir2/file.txt" )
9696
9797 // Note that the directory doesn't allow writing.
9898 // This means that the copy operation must temporarily lift that restriction to copy the
9999 // nested file.
100100 file .chmod dir read-only-dir-permission
101101 file .copy --source = dir --target = "$ tmp-dir /dir3" --recursive
102102 expect-equals read-only-dir-permission ( file .stat "$ tmp-dir /dir3" ) [ file .ST-MODE ]
103- expect-equals "gee" .to-byte-array ( file .read-content "$ tmp-dir /dir2/file.txt" )
103+ expect-equals "gee" .to-byte-array ( file .read-contents "$ tmp-dir /dir2/file.txt" )
104104
105105test-symlinks :
106106 with-tmp-dir : | tmp-dir |
107107 file-target := "$ tmp-dir /file.txt"
108108 file-content := "foobar" .to-byte-array
109- file .write-content --path = file-target file-content
109+ file .write-contents --path = file-target file-content
110110 dir-target := "$ tmp-dir /dir"
111111 directory .mkdir dir-target
112112 dir-file := "$ dir-target /file.txt"
113113 dir-file-content := "gee" .to-byte-array
114- file .write-content --path = dir-file dir-file-content
114+ file .write-contents --path = dir-file dir-file-content
115115
116116 source-dir := "$ tmp-dir /source"
117117 directory .mkdir source-dir
@@ -125,39 +125,39 @@ test-symlinks:
125125
126126 copy-target := "$ tmp-dir /copy-target-symlink"
127127 file .copy --source = source-dir --target = copy-target --recursive
128- expect-equals file-content ( file .read-content "$ copy-target /relative-link" )
129- expect-equals file-content ( file .read-content "$ copy-target /absolute-link" )
128+ expect-equals file-content ( file .read-contents "$ copy-target /relative-link" )
129+ expect-equals file-content ( file .read-contents "$ copy-target /absolute-link" )
130130 // Change the original file.
131131 // Since the copy is still a link we expect the content to change.
132132 file-content2 := "foobar2" .to-byte-array
133- file .write-content --path = file-target file-content2
134- expect-equals file-content2 ( file .read-content "$ copy-target /relative-link" )
135- expect-equals file-content2 ( file .read-content "$ copy-target /absolute-link" )
133+ file .write-contents --path = file-target file-content2
134+ expect-equals file-content2 ( file .read-contents "$ copy-target /relative-link" )
135+ expect-equals file-content2 ( file .read-contents "$ copy-target /absolute-link" )
136136 expect ( is-link "$ copy-target /relative-link" )
137137 expect ( is-link "$ copy-target /absolute-link" )
138138
139- expect-equals dir-file-content ( file .read-content "$ copy-target /relative-dir/file.txt" )
140- expect-equals dir-file-content ( file .read-content "$ copy-target /absolute-dir/file.txt" )
139+ expect-equals dir-file-content ( file .read-contents "$ copy-target /relative-dir/file.txt" )
140+ expect-equals dir-file-content ( file .read-contents "$ copy-target /absolute-dir/file.txt" )
141141 // Change the original file.
142142 // Since the copy is still a link we expect the content to change.
143143 dir-file-content2 := "gee2" .to-byte-array
144- file .write-content --path = dir-file dir-file-content2
145- expect-equals dir-file-content2 ( file .read-content "$ copy-target /relative-dir/file.txt" )
146- expect-equals dir-file-content2 ( file .read-content "$ copy-target /absolute-dir/file.txt" )
144+ file .write-contents --path = dir-file dir-file-content2
145+ expect-equals dir-file-content2 ( file .read-contents "$ copy-target /relative-dir/file.txt" )
146+ expect-equals dir-file-content2 ( file .read-contents "$ copy-target /absolute-dir/file.txt" )
147147 expect ( is-link "$ copy-target /relative-dir" )
148148 expect ( is-link "$ copy-target /absolute-dir" )
149149
150150 // Dereference links.
151151 copy-target = "$ tmp-dir /copy-target-dereference"
152152
153153 file .copy --source = source-dir --target = copy-target --recursive --dereference
154- expect-equals file-content2 ( file .read-content "$ copy-target /relative-link" )
155- expect-equals file-content2 ( file .read-content "$ copy-target /absolute-link" )
154+ expect-equals file-content2 ( file .read-contents "$ copy-target /relative-link" )
155+ expect-equals file-content2 ( file .read-contents "$ copy-target /absolute-link" )
156156 expect-not ( is-link "$ copy-target /relative-link" )
157157 expect-not ( is-link "$ copy-target /absolute-link" )
158158
159- expect-equals dir-file-content2 ( file .read-content "$ copy-target /relative-dir/file.txt" )
160- expect-equals dir-file-content2 ( file .read-content "$ copy-target /absolute-dir/file.txt" )
159+ expect-equals dir-file-content2 ( file .read-contents "$ copy-target /relative-dir/file.txt" )
160+ expect-equals dir-file-content2 ( file .read-contents "$ copy-target /absolute-dir/file.txt" )
161161 expect-not ( is-link "$ copy-target /relative-dir" )
162162 expect-not ( is-link "$ copy-target /absolute-dir" )
163163
@@ -168,23 +168,23 @@ test-symlinks:
168168 file .copy --source = source-dir --target = copy-target --recursive
169169
170170 // Absolute links still work.
171- expect-equals file-content2 ( file .read-content "$ copy-target /absolute-link" )
171+ expect-equals file-content2 ( file .read-contents "$ copy-target /absolute-link" )
172172 expect ( is-link "$ copy-target /absolute-link" )
173- expect-equals dir-file-content2 ( file .read-content "$ copy-target /absolute-dir/file.txt" )
173+ expect-equals dir-file-content2 ( file .read-contents "$ copy-target /absolute-dir/file.txt" )
174174 expect ( is-link "$ copy-target /absolute-dir" )
175175
176- expect-throws : file .read-content "$ copy-target /relative-link"
176+ expect-throws : file .read-contents "$ copy-target /relative-link"
177177 expect ( is-link "$ copy-target /relative-link" )
178- expect-throws : file .read-content "$ copy-target /relative-dir/file.txt"
178+ expect-throws : file .read-contents "$ copy-target /relative-dir/file.txt"
179179 expect ( is-link "$ copy-target /relative-dir" )
180180
181181 // Create the target.
182- file .write-content --path = "$ tmp-dir /other/file.txt" file-content
182+ file .write-contents --path = "$ tmp-dir /other/file.txt" file-content
183183 directory .mkdir "$ tmp-dir /other/dir"
184- file .write-content --path = "$ tmp-dir /other/dir/file.txt" dir-file-content
184+ file .write-contents --path = "$ tmp-dir /other/dir/file.txt" dir-file-content
185185 // Now the symlinks work again.
186- expect-equals file-content ( file .read-content "$ copy-target /relative-link" )
187- expect-equals dir-file-content ( file .read-content "$ copy-target /relative-dir/file.txt" )
186+ expect-equals file-content ( file .read-contents "$ copy-target /relative-link" )
187+ expect-equals dir-file-content ( file .read-contents "$ copy-target /relative-dir/file.txt" )
188188
189189is-link path / string -> bool :
190190 stat := file .stat path --no-follow-links
0 commit comments