Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

the tests

  • Loading branch information...
commit f2f32393e3cae4f4cece9a35f8af12d1e232af87 1 parent 44b7480
@isaacs authored
View
10 test/run.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+for i in test-*.js; do
+ echo -n $i ...
+ bash setup.sh
+ node $i
+ ! [ -d target ]
+ echo "pass"
+done
+rm -rf target
View
47 test/setup.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -e
+
+files=10
+folders=2
+depth=4
+target="$PWD/target"
+
+rm -rf target
+
+fill () {
+ local depth=$1
+ local files=$2
+ local folders=$3
+ local target=$4
+
+ if ! [ -d $target ]; then
+ mkdir -p $target
+ fi
+
+ local f
+
+ f=$files
+ while [ $f -gt 0 ]; do
+ touch "$target/f-$depth-$f"
+ let f--
+ done
+
+ let depth--
+
+ if [ $depth -le 0 ]; then
+ return 0
+ fi
+
+ f=$folders
+ while [ $f -gt 0 ]; do
+ mkdir "$target/folder-$depth-$f"
+ fill $depth $files $folders "$target/d-$depth-$f"
+ let f--
+ done
+}
+
+fill $depth $files $folders $target
+
+# sanity assert
+[ -d $target ]
View
5 test/test-async.js
@@ -0,0 +1,5 @@
+var rimraf = require("../rimraf")
+ , path = require("path")
+rimraf(path.join(__dirname, "target"), function (er) {
+ if (er) throw er
+})
View
3  test/test-sync.js
@@ -0,0 +1,3 @@
+var rimraf = require("../rimraf")
+ , path = require("path")
+rimraf.sync(path.join(__dirname, "target"))
Please sign in to comment.
Something went wrong with that request. Please try again.