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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user