Change LuaC to read bytes instead of chars.

This fixes some of the test cases by avoiding a lossy round-trip conversion
from bytes presumed to be, but might not be, UTF-8 encoded characters, and
then back to bytes. All of the compiler test cases now pass.
This commit is contained in:
Ian Farmer
2008-02-13 08:02:17 +00:00
parent 9c4bbf670f
commit 1672e73c40
6 changed files with 57 additions and 40 deletions

View File

@@ -179,6 +179,7 @@ public class LuaJTest extends TestCase {
// load the file
LPrototype p = loadScriptResource( state, testName );
p.source = LString.valueOf("stdin");
// Replace System.out with a ByteArrayOutputStream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -208,7 +209,9 @@ public class LuaJTest extends TestCase {
}
try {
return LoadState.undump(state, script, name);
// Use "stdin" instead of resource name so that output matches
// standard Lua.
return LoadState.undump(state, script, "stdin");
} finally {
script.close();
}