aboutsummaryrefslogtreecommitdiff
path: root/testes/utf8.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* utf8.offset returns also final position of characterRoberto Ierusalimschy2024-05-271-17/+27
| | | | | 'utf8.offset' returns two values: the initial and the final position of the given character.
* More control over encoding of test filesRoberto Ierusalimschy2023-08-171-0/+2
| | | | | 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-1/+1
| | | | | Test files are more polite regarding the use of globals when locals would do, and when globals are necessary deleting them after use.
* Bug: 'utf8.codes' accepts spurious continuation bytesRoberto Ierusalimschy2022-09-231-1/+11
|
* Avoid overflows when incrementing parameters in CRoberto Ierusalimschy2021-09-221-0/+6
| | | | | | Any C function can receive maxinteger as an integer argument, and therefore cannot increment it without some care (e.g., doing unsigned arithmetic as the core does).
* Details (more uniformity in error messages)Roberto Ierusalimschy2020-05-271-9/+9
|
* Added macro 'luaL_pushfail'Roberto Ierusalimschy2019-08-161-2/+2
| | | | | | | | 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'.
* Fixed wrong error message in 'return math.seed(0)'Roberto Ierusalimschy2019-04-041-1/+1
| | | | | | Bug introduced in commit 28d829c8: OP_TAILCALL might raise an error without saving 'pc'. (This commit also fixes a detail in 'testes/uf8.lua'.)
* Small optimizations in range checksRoberto Ierusalimschy2019-03-271-0/+3
| | | | | | | | Checks of the form '1 <= x && x <= M' were rewritten in the form '(unsigned)x - 1 < (unsigned)M', which is usually more efficient. (Other similar checks have similar translations.) Although some compilers do these optimizations, that does not happen for all compilers or all cases.
* Changes in the validation of UTF-8Roberto Ierusalimschy2019-03-151-32/+60
| | | | | | | | | | | All UTF-8 encoding functionality (including the escape sequence '\u') accepts all values from the original UTF-8 specification (with sequences of up to six bytes). By default, the decoding functions in the UTF-8 library do not accept invalid Unicode code points, such as surrogates. A new parameter 'nonstrict' makes them accept all code points up to (2^31)-1, as in the original UTF-8 specification.
* 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/+210