Add oslib tests.
This commit is contained in:
@@ -116,6 +116,10 @@ public class CompatibiltyTest extends ScriptDrivenTest {
|
||||
runTest("next");
|
||||
}
|
||||
|
||||
public void testOsLib() throws IOException, InterruptedException {
|
||||
runTest("oslib");
|
||||
}
|
||||
|
||||
public void testPcalls() throws IOException, InterruptedException {
|
||||
runTest("pcalls");
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ print( 'os', os ~= nil )
|
||||
print( 'os.clock()', pcall( os.clock ) )
|
||||
print( 'os.date()', pcall( os.date ) )
|
||||
print( 'os.difftime(123000, 21250)', pcall( os.difftime, 123000, 21250 ) )
|
||||
print( 'os.execute("ipconfig")', pcall( os.execute, 'ipconfig' ) )
|
||||
print( 'os.execute("hostname")', pcall( os.execute, 'hostname' ) )
|
||||
print( 'os.execute("")', pcall( os.execute, '' ) )
|
||||
print( 'os.getenv()', pcall( os.getenv ) )
|
||||
print( 'os.getenv("bogus.key")', pcall( os.getenv, 'bogus.key' ) )
|
||||
@@ -32,5 +32,5 @@ print( 'os.setlocale("us","monetary")', pcall( os.setlocale, "us", "monetary" )
|
||||
print( 'os.setlocale(nil,"all")', pcall( os.setlocale, nil, "all" ) )
|
||||
print( 'os.setlocale("c")', pcall( os.setlocale, "c" ) )
|
||||
print( 'os.exit(123)' )
|
||||
print( pcall( os.exit, -123 ) )
|
||||
-- print( pcall( os.exit, -123 ) )
|
||||
print( 'failed to exit' )
|
||||
|
||||
Reference in New Issue
Block a user