aboutsummaryrefslogtreecommitdiff
path: root/testes/attrib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/attrib.lua')
-rw-r--r--testes/attrib.lua24
1 files changed, 22 insertions, 2 deletions
diff --git a/testes/attrib.lua b/testes/attrib.lua
index d8b6e0f3..f4156086 100644
--- a/testes/attrib.lua
+++ b/testes/attrib.lua
@@ -308,11 +308,11 @@ else
308 _ENV.x, _ENV.y = nil 308 _ENV.x, _ENV.y = nil
309end 309end
310 310
311
311_ENV = _G 312_ENV = _G
312 313
313 314
314-- testing preload 315-- testing preload
315
316do 316do
317 local p = package 317 local p = package
318 package = {} 318 package = {}
@@ -331,6 +331,26 @@ do
331 assert(type(package.path) == "string") 331 assert(type(package.path) == "string")
332end 332end
333 333
334
335do print("testing external strings")
336 package.cpath = DC"?"
337 local lib2 = require"lib2-v2"
338 local t = {}
339 for _, len in ipairs{0, 10, 39, 40, 41, 1000} do
340 local str = string.rep("a", len)
341 local str1 = lib2.newstr(str)
342 assert(str == str1)
343 assert(not T or T.hash(str) == T.hash(str1))
344 t[str1] = 20; assert(t[str] == 20 and t[str1] == 20)
345 t[str] = 10; assert(t[str1] == 10)
346 local tt = {[str1] = str1}
347 assert(next(tt) == str1 and next(tt, str1) == nil)
348 assert(tt[str] == str)
349 local str2 = lib2.newstr(str1)
350 assert(str == str2 and t[str2] == 10 and tt[str2] == str)
351 end
352end
353
334print('+') 354print('+')
335 355
336end --] 356end --]
@@ -447,7 +467,7 @@ do
447end 467end
448 468
449 469
450-- test of large float/integer indices 470-- test of large float/integer indices
451 471
452-- compute maximum integer where all bits fit in a float 472-- compute maximum integer where all bits fit in a float
453local maxint = math.maxinteger 473local maxint = math.maxinteger