diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-09 12:10:31 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-09 12:10:31 -0300 |
commit | d881325c2fcbb6d2c434ec403b0bbe51ac200c7b (patch) | |
tree | 811c1a1ffa8f91693b8df64e040c509c2cec6ded /testes/files.lua | |
parent | 3f253f116e8e292977a1bded964544fb35b3d1e3 (diff) | |
download | lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.tar.gz lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.tar.bz2 lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.zip |
Flag for to-be-closed variables changed to '<toclose>'
The flag for to-be-closed variables was changed from '*toclose'
to '<toclose>'. Several people found confusing the old syntax and
the new one has a clear terminator, making it more flexible for
future changes.
Diffstat (limited to 'testes/files.lua')
-rw-r--r-- | testes/files.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/files.lua b/testes/files.lua index 38d3a669..eb100fe1 100644 --- a/testes/files.lua +++ b/testes/files.lua | |||
@@ -125,7 +125,7 @@ do | |||
125 | -- closing file by scope | 125 | -- closing file by scope |
126 | local F = nil | 126 | local F = nil |
127 | do | 127 | do |
128 | local *toclose f = assert(io.open(file, "w")) | 128 | local <toclose> f = assert(io.open(file, "w")) |
129 | F = f | 129 | F = f |
130 | end | 130 | end |
131 | assert(tostring(F) == "file (closed)") | 131 | assert(tostring(F) == "file (closed)") |
@@ -135,7 +135,7 @@ assert(os.remove(file)) | |||
135 | 135 | ||
136 | do | 136 | do |
137 | -- test writing/reading numbers | 137 | -- test writing/reading numbers |
138 | local *toclose f = assert(io.open(file, "w")) | 138 | local <toclose> f = assert(io.open(file, "w")) |
139 | f:write(maxint, '\n') | 139 | f:write(maxint, '\n') |
140 | f:write(string.format("0X%x\n", maxint)) | 140 | f:write(string.format("0X%x\n", maxint)) |
141 | f:write("0xABCp-3", '\n') | 141 | f:write("0xABCp-3", '\n') |
@@ -158,7 +158,7 @@ assert(os.remove(file)) | |||
158 | 158 | ||
159 | -- testing multiple arguments to io.read | 159 | -- testing multiple arguments to io.read |
160 | do | 160 | do |
161 | local *toclose f = assert(io.open(file, "w")) | 161 | local <toclose> f = assert(io.open(file, "w")) |
162 | f:write[[ | 162 | f:write[[ |
163 | a line | 163 | a line |
164 | another line | 164 | another line |