diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-11-08 11:43:42 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-11-08 11:43:42 -0300 |
| commit | e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa (patch) | |
| tree | 090174ab9a66fbec195e9dd539710ab19370ec2f /testes/memerr.lua | |
| parent | f791bb69061c15f73395c5a95958ac18af5ef764 (diff) | |
| download | lua-e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa.tar.gz lua-e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa.tar.bz2 lua-e44f3a2ffc7ced5e75cca7657aaa60ef27da89aa.zip | |
Global initialization checks name conflict
Initialization "global a = 10" raises an error if global 'a' is already
defined, that is, it has a non-nil value.
Diffstat (limited to 'testes/memerr.lua')
| -rw-r--r-- | testes/memerr.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/memerr.lua b/testes/memerr.lua index 2cc8f481..9c940ca7 100644 --- a/testes/memerr.lua +++ b/testes/memerr.lua | |||
| @@ -166,9 +166,9 @@ local function expand (n,s) | |||
| 166 | e, s, expand(n-1,s), e) | 166 | e, s, expand(n-1,s), e) |
| 167 | end | 167 | end |
| 168 | 168 | ||
| 169 | G=0; collectgarbage(); a =collectgarbage("count") | 169 | G=0; collectgarbage() |
| 170 | load(expand(20,"G=G+1"))() | 170 | load(expand(20,"G=G+1"))() |
| 171 | assert(G==20); collectgarbage(); -- assert(gcinfo() <= a+1) | 171 | assert(G==20); collectgarbage() |
| 172 | G = nil | 172 | G = nil |
| 173 | 173 | ||
| 174 | testamem("running code on new thread", function () | 174 | testamem("running code on new thread", function () |
