Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / tests / filesys / extended / dir-rm-cwd-cd.ck
diff --git a/src/tests/filesys/extended/dir-rm-cwd-cd.ck b/src/tests/filesys/extended/dir-rm-cwd-cd.ck
new file mode 100644 (file)
index 0000000..fc49668
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF', <<'EOF']);
+(dir-rm-cwd-cd) begin
+(dir-rm-cwd-cd) mkdir "a"
+(dir-rm-cwd-cd) chdir "a"
+(dir-rm-cwd-cd) remove "/a" (must not crash)
+(dir-rm-cwd-cd) chdir "/a" (remove succeeded so this must return false)
+(dir-rm-cwd-cd) end
+EOF
+(dir-rm-cwd-cd) begin
+(dir-rm-cwd-cd) mkdir "a"
+(dir-rm-cwd-cd) chdir "a"
+(dir-rm-cwd-cd) remove "/a" (must not crash)
+(dir-rm-cwd-cd) chdir "/a" (remove failed so this must succeed)
+(dir-rm-cwd-cd) end
+EOF