aboutsummaryrefslogtreecommitdiff
path: root/testes/files.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* More control over encoding of test filesRoberto Ierusalimschy2023-08-171-4/+4
| | | | | The few UTF-8 test files are commented as such, and there is only one non UTF-8 test file (to test non UTF-8 sources).
* Avoid excessive name pollution in test filesRoberto Ierusalimschy2022-12-281-2/+4
| | | | | Test files are more polite regarding the use of globals when locals would do, and when globals are necessary deleting them after use.
* Small simplification in overflow check in 'getfield'Roberto Ierusalimschy2022-09-231-0/+9
| | | | | Subtracting a small non-negative int from a non-negative int cannot overflow, and adding a non-negative int to INT_MIN cannot overflow.
* Fixed bug: invalid mode can crash 'io.popen'Roberto Ierusalimschy2020-07-151-0/+15
|
* Added macro 'luaL_pushfail'Roberto Ierusalimschy2019-08-161-15/+15
| | | | | | | | The macro 'luaL_pushfail' documents all places in the standard libraries that return nil to signal some kind of failure. It is defined as 'lua_pushnil'. The manual also got a notation (@fail) to document those returns. The tests were changed to be agnostic regarding whether 'fail' is 'nil' or 'false'.
* Change in the syntax of attributesRoberto Ierusalimschy2019-07-301-7/+7
| | | | | | | Attributes changed to posfixed ('x <const>', instead of '<const> x'), and "toclose" renamed to "close". Posfixed attributes seem to make it clearer that it applies to only one variable when there are multiple variables.
* Some improvements in date/time functionsRoberto Ierusalimschy2019-07-241-13/+52
| | | | | | - Range in date table extended to full 32 bits. - Easier support for times represented as floats. - Added more tests.
* DetailsRoberto Ierusalimschy2019-07-101-3/+5
| | | | | | | | In the generic for loop, it is simpler for OP_TFORLOOP to use the same 'ra' as OP_TFORCALL. Moreover, the internal names of the loop temporaries "(for ...)" don't need to leak internal details (even because the numerical for loop doesn't have a fixed role for each of its temporaries).
* First implementation for 'const' variablesRoberto Ierusalimschy2019-05-171-4/+4
| | | | | A variable can be declared const, which means it cannot be assigned to, with the syntax 'local <const> name = exp'.
* Flag for to-be-closed variables changed to '<toclose>'Roberto Ierusalimschy2019-05-091-3/+3
| | | | | | | 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.
* Small correction in test about 'isdst'Roberto Ierusalimschy2019-04-221-1/+1
| | | | | The field 'isdst' can be false, so we cannot test its absence with 'if not D.isdst'; we must compare with nil for a correct test.
* Corrected tests around non-portable 'isdst' in datesRoberto Ierusalimschy2019-04-091-3/+7
| | | | | The field 'isdst' in date tables may not be present; portable tests should not assume it is.
* To-be-closed variable in 'for' loop separated from the stateRoberto Ierusalimschy2018-11-071-1/+36
| | | | | | | | | The variable to be closed in a generic 'for' loop now is the 4th value produced in the loop initialization, instead of being the loop state (the 2nd value produced). That allows a loop to use a state with a '__toclose' metamethod but do not close it. (As an example, 'f:lines()' might use the file 'f' as a state for the loop, but it should not close the file when the loop ends.)
* New syntax for to-be-closed variablesRoberto Ierusalimschy2018-11-071-3/+3
| | | | | | | The new syntax is <local *toclose x = f()>. The mark '*' allows other attributes to be added later without the need of new keywords; it also allows better error messages. The API function was also renamed ('lua_tobeclosed' -> 'lua_toclose').
* State in generic 'for' acts as a to-be-closed variableRoberto Ierusalimschy2018-10-311-4/+4
| | | | | | | | | | | The implicit variable 'state' in a generic 'for' is marked as a to-be-closed variable, so that the state will be closed as soon as the loop ends, no matter how. Taking advantage of this new facility, the call 'io.lines(filename)' now returns the open file as a second result. Therefore, an iteraction like 'for l in io.lines(name)...' will close the file even when the loop ends with a break or an error.
* Added a '__close' metamethod to file handlesRoberto Ierusalimschy2018-10-231-22/+35
|
* Added directory to test file names in '$Id:'Roberto Ierusalimschy2018-07-251-1/+1
| | | | | | | From the point of view of 'git', all names are relative to the root directory of the project. So, file names in '$Id:' also should be relative to that directory: the proper name for test file 'all.lua' is 'testes/all.lua'.
* Added manual and tests for version 5.4-w2Roberto Ierusalimschy2018-07-091-0/+832