aboutsummaryrefslogtreecommitdiff
path: root/tests/unistd/io.js
diff options
context:
space:
mode:
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);
+})();