aboutsummaryrefslogtreecommitdiff
path: root/tests/unistd/io.js
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-07-23 05:49:48 +0300
committermax99x <max99x@gmail.com>2011-07-23 05:49:48 +0300
commit136756f734ecf14a28736900075d561e981e973e (patch)
treecf33472ea6550c6486ec7722facf34d98a16a51d /tests/unistd/io.js
parent586d229ec311daa5e89781eb6da822989e677789 (diff)
Added unistd tests; fixed a lot of unistd bugs and deficiencies.
Diffstat (limited to 'tests/unistd/io.js')
-rw-r--r--tests/unistd/io.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unistd/io.js b/tests/unistd/io.js
new file mode 100644
index 00000000..b129af44
--- /dev/null
+++ b/tests/unistd/io.js
@@ -0,0 +1,19 @@
+(function() {
+ var devicePayload = [65, 66, 67, 68];
+ FS.createDevice('/', 'device', function() {
+ if (devicePayload.length) {
+ return devicePayload.shift();
+ } else {
+ return null;
+ }
+ }, function(arg) {
+ print("TO DEVICE: " + arg);
+ });
+ FS.createDevice('/', 'broken-device', function() {
+ throw new Error('Broken device input.');
+ }, function(arg) {
+ throw new Error('Broken device output.');
+ });
+ FS.createDataFile('/', 'file', '1234567890', true, true);
+ FS.createFolder('/', 'folder', true, true);
+})();