Commit Graph

76 Commits

Author SHA1 Message Date
James Roseborough
9d728af4a6 Add simple loadstring test. 2007-12-13 01:43:21 +00:00
James Roseborough
78b231353f quote results. 2007-12-13 01:04:08 +00:00
James Roseborough
b8b65767b5 More test cases for string.sub() 2007-12-13 01:03:02 +00:00
Ian Farmer
60cc93d64c Correctly remove values stored in the array-part of a table. 2007-12-12 19:19:03 +00:00
James Roseborough
6569563ddc Implement math.pow() for all platforms, add unit tests for basic math operations. 2007-12-11 19:47:38 +00:00
James Roseborough
ab8fc4883e Implement foreach(), foreachi() 2007-12-11 01:18:04 +00:00
James Roseborough
1923d8e6a0 Add math.random() and math.randomseed() 2007-12-08 01:42:51 +00:00
James Roseborough
0f3fe0452d Add table.getn() for compatibility 2007-12-08 01:20:30 +00:00
James Roseborough
9cf85debad Add test cases for loadfile, dofile on bad filenames. 2007-12-07 18:43:34 +00:00
James Roseborough
d7c15f99a1 fix setmetatable() to match C version 2007-12-07 00:52:39 +00:00
James Roseborough
dc08fcbec2 Send test error output to System.err 2007-12-06 23:31:11 +00:00
James Roseborough
e8e1aaf892 Fix for loop processing, add vmerror() 2007-12-06 22:59:16 +00:00
James Roseborough
edd8bc33ea remove compiled versions of test files 2007-12-06 21:14:44 +00:00
Ian Farmer
a6f46413c0 Added 'loops' test case.
This script tests the generic for loop using a Lua closure as the iterator
function, which is currently broken.
2007-12-06 19:16:56 +00:00
James Roseborough
644896c467 Improve error reporting. 2007-12-06 15:29:49 +00:00
James Roseborough
8f581c8f07 Improve testing around require() features. 2007-12-05 22:00:37 +00:00
James Roseborough
7db4d54d50 Implement require() using package.loaders, etc. add preload_loader, lua_loader, and java_loader. 2007-12-05 01:46:59 +00:00
James Roseborough
0db9925ee9 Add test scripts for require() 2007-11-30 16:41:59 +00:00
James Roseborough
b493230edb Initial implementation of module, package.seeall 2007-11-29 01:11:18 +00:00
James Roseborough
62a3510272 Fix next() 2007-11-20 00:10:18 +00:00
Ian Farmer
ad5e776dc9 Add a string.gmatch call to strlib.lua test case and fix the bug it exposed. 2007-11-19 23:06:26 +00:00
James Roseborough
f2867eee0d tests for tostring, tonumber 2007-11-16 19:45:12 +00:00
James Roseborough
eef469c715 Add unit tests for part of base library plus fixes to [gs]etfenv, [gs]etmetatable 2007-11-16 00:41:43 +00:00
James Roseborough
ff66779330 Major refactoring of package names, class names 2007-11-07 23:56:06 +00:00
James Roseborough
d6a3525357 Fix return value of table.remove() 2007-11-06 23:33:11 +00:00
James Roseborough
ec5068a96e Fix select for "#" argument 2007-11-05 19:16:08 +00:00
James Roseborough
c93301506a Replace deprecated API's 2007-11-05 17:19:46 +00:00
James Roseborough
434530b60f Table unit tests and implementation of table.remove(), table.sort() 2007-10-31 23:24:51 +00:00
James Roseborough
facb8d1d07 Unit test for table package functions 2007-10-31 19:03:18 +00:00
James Roseborough
b86e06ab1c Coroutine implementation based on Java Threads. 2007-10-23 21:24:49 +00:00
James Roseborough
504020beda Fix coroutine.wrap() error propogation. 2007-10-23 00:49:52 +00:00
James Roseborough
932960c846 Add tests for pcall, add error() builtin, fix assert(), error levels. 2007-10-23 00:34:04 +00:00
James Roseborough
8248cca2bf implement corouting.wrap(), fix bugs in coroutine.status(), fix StackState.insert() 2007-10-22 21:05:04 +00:00
James Roseborough
78eaaf0fa0 Initial draft of coroutines library. 2007-10-20 00:51:15 +00:00
James Roseborough
435368ccd9 Fix metatable processing on luaGetTable 2007-10-09 04:09:00 +00:00
Ian Farmer
ec11c472c8 Various changes to bring pm.lua test closer to passing:
* New and complete character class support
 * string.gsub implemented
 * rawset implemented
 * lua_call added (based on lua_pcall)
 * lua_pop added
 * newCall removed; luaGetTable and luaSetTable in LFunction updated to
   use lua_call instead.
 * StandardTest changed to avoid an ArrayIndexOutOfBoundsException

Unfortunately I discovered a problem where execute() will loop around too
many times and call exec() with a call frame that has already completed.
This might be due to the lack of the "tailcalls" field in our CallInfo class
that the C version maintains?
2007-09-24 04:35:53 +00:00
Ian Farmer
f801e648bb New math.cos and math.sqrt functions from Lua standard library, with new
math library test case. Also, character encoding of LuaCompat was changed
from something that Eclipse was not handling well to UTF-8.
2007-09-23 03:54:06 +00:00
Ian Farmer
fc8c790b0d Fixes for string.rep, string.byte, string.lower, and string.upper. Also
factor out negative index handling to separate function, posrelat (to
match C Lua). When converting numbers to strings, see if the double value
can be represented exactly as a long, and if so format the string as
an integer. With these changes the standard test case "strings.lua" runs
to line 104 (over half way through!), where it uses string.format.
2007-09-19 04:44:31 +00:00
Ian Farmer
bd6dd58a2d String related improvements:
(1) Fix string.char and string.byte (argument indexing was off by one)
(2) Implement string.find
(3) Change calls to charAt, which does array bounds checking, in the
    pattern matcher with calls to luaByte, which does not.
(4) Replace use of recursion with while/continue in pattern matcher.
2007-09-18 05:17:09 +00:00
Ian Farmer
108fabc58f Add missing return statement in autoload test case. Still doesn't work. 2007-09-18 04:16:46 +00:00
Ian Farmer
aa44eedf4b Allow metatable operations on values of all types, and use the metatable
on strings as the string package, so that string functions can be called
with self (:) syntax. Autoload test case now inexplicably fails more,
but it was already broken.
2007-09-08 20:54:40 +00:00
Ian Farmer
35131f9f66 Fix "factorial" function in test case that was not actually factorial function. 2007-09-05 03:02:57 +00:00
Ian Farmer
75fb975410 Fix a few VM issues which were causing subtle failures in the test cases.
Includes a new VM method, newCall, which must be called before pushing
a call onto the stack to make sure that base is set correctly.
A couple of weird issues remain with autoload.lua.
2007-09-04 01:52:33 +00:00
James Roseborough
b8376fe0ef Fix tail call argument handling. 2007-08-03 05:42:50 +00:00
James Roseborough
5fb097d107 Fix varargs handling 2007-08-02 03:00:46 +00:00
Ian Farmer
737c5e2855 Various changes:
(1) New lua compatibility bindings, including select() and math functions
(2) fix some VM bugs
(3) fix some table bugs, and attempt to restore metatable functionality.
2007-08-01 04:15:27 +00:00
Ian Farmer
ee5007e718 Add implicit LString to number coercions. 2007-07-22 06:20:14 +00:00
Ian Farmer
e1d6ddf99c New autoload and math test cases. Currently autoload does not work because
the GETGLOBAL instruction does not handle the case where a metatable method
is invoked.
2007-07-21 04:44:22 +00:00
Ian Farmer
b4ac032fd7 Fix the NOT instruction. Includes test case. 2007-07-21 04:08:28 +00:00
Ian Farmer
8c3fe262f9 Adding test suite with tests from the set of standard Lua test cases. These
test cases were downloaded from:
  http://www.inf.puc-rio.br/~roberto/lua/lua5.1-tests.tar.gz
2007-07-17 03:20:53 +00:00