mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Library rename, added HAL, added open function
This commit is contained in:
20
test/scripts/lib/fileio.toy
Normal file
20
test/scripts/lib/fileio.toy
Normal file
@@ -0,0 +1,20 @@
|
||||
import fileio;
|
||||
|
||||
// test constants
|
||||
{
|
||||
// print MAX_FILENAME_SIZE;
|
||||
// print MAX_FILES_OPEN;
|
||||
// print END_OF_FILE;
|
||||
|
||||
assert END_OF_FILE < 0, "END_OF_FILE failed";
|
||||
}
|
||||
|
||||
// test open
|
||||
{
|
||||
var file = open("doesNotExist.txt", "r");
|
||||
|
||||
assert file["error"] == true, "error failed";
|
||||
assert file["size"] == 0, "size failed";
|
||||
|
||||
// close(file);
|
||||
}
|
||||
1
test/scripts/lib/fileio.txt
Normal file
1
test/scripts/lib/fileio.txt
Normal file
@@ -0,0 +1 @@
|
||||
Hello, World!
|
||||
@@ -1 +0,0 @@
|
||||
print "Nothing is here";
|
||||
Reference in New Issue
Block a user