Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: test/mjsunit/d8-os.js

Issue 1544793002: [tests] Fix bogus uses of assertThrows. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/asm/infinite-loops-taken.js ('k') | test/mjsunit/es6/array-tostring.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/d8-os.js
diff --git a/test/mjsunit/d8-os.js b/test/mjsunit/d8-os.js
index 29d31032e741cc11a40179289747227b93068797..c2d8ec59bc053d3216aa871224af85ee4506ee09 100644
--- a/test/mjsunit/d8-os.js
+++ b/test/mjsunit/d8-os.js
@@ -73,7 +73,7 @@ if (this.os && os.system) {
// Check that they are there.
os.system('ls', [TEST_DIR + '/dir/foo']);
// Check that we can detect when something is not there.
- assertThrows("os.system('ls', [TEST_DIR + '/dir/bar']);", "dir not there");
+ assertThrows("os.system('ls', [TEST_DIR + '/dir/bar']);");
// Check that mkdirp makes intermediate directories.
os.mkdirp(TEST_DIR + "/dir2/foo");
os.system("ls", [TEST_DIR + "/dir2/foo"]);
@@ -86,16 +86,16 @@ if (this.os && os.system) {
// Check that we get an error if the name is taken by a file.
os.system("sh", ["-c", "echo foo > " + TEST_DIR + "/file1"]);
os.system("ls", [TEST_DIR + "/file1"]);
- assertThrows("os.mkdirp(TEST_DIR + '/file1');", "mkdir over file1");
- assertThrows("os.mkdirp(TEST_DIR + '/file1/foo');", "mkdir over file2");
- assertThrows("os.mkdirp(TEST_DIR + '/file1/');", "mkdir over file3");
- assertThrows("os.mkdirp(TEST_DIR + '/file1/foo/');", "mkdir over file4");
+ assertThrows("os.mkdirp(TEST_DIR + '/file1');");
+ assertThrows("os.mkdirp(TEST_DIR + '/file1/foo');");
+ assertThrows("os.mkdirp(TEST_DIR + '/file1/');");
+ assertThrows("os.mkdirp(TEST_DIR + '/file1/foo/');");
// Create a dir we cannot read.
os.mkdirp(TEST_DIR + "/dir4", 0);
// This test fails if you are root since root can read any dir.
- assertThrows("os.chdir(TEST_DIR + '/dir4');", "chdir dir4 I");
+ assertThrows("os.chdir(TEST_DIR + '/dir4');");
os.rmdir(TEST_DIR + "/dir4");
- assertThrows("os.chdir(TEST_DIR + '/dir4');", "chdir dir4 II");
+ assertThrows("os.chdir(TEST_DIR + '/dir4');");
// Set umask. This changes the umask for the whole process and is
// the reason why the test cannot be run multi-threaded.
@@ -103,9 +103,9 @@ if (this.os && os.system) {
// Create a dir we cannot read.
os.mkdirp(TEST_DIR + "/dir5");
// This test fails if you are root since root can read any dir.
- assertThrows("os.chdir(TEST_DIR + '/dir5');", "cd dir5 I");
+ assertThrows("os.chdir(TEST_DIR + '/dir5');");
os.rmdir(TEST_DIR + "/dir5");
- assertThrows("os.chdir(TEST_DIR + '/dir5');", "chdir dir5 II");
+ assertThrows("os.chdir(TEST_DIR + '/dir5');");
os.umask(old_umask);
os.mkdirp(TEST_DIR + "/hest/fisk/../fisk/ged");
@@ -129,10 +129,10 @@ if (this.os && os.system) {
have_echo = false;
}
if (have_sleep) {
- assertThrows("os.system('sleep', ['2000'], 20);", "sleep 1");
+ assertThrows("os.system('sleep', ['2000'], 20);");
// Check we time out with total time.
- assertThrows("os.system('sleep', ['2000'], -1, 20);", "sleep 2");
+ assertThrows("os.system('sleep', ['2000'], -1, 20);");
// Check that -1 means no timeout.
os.system('sleep', ['1'], -1, -1);
« no previous file with comments | « test/mjsunit/asm/infinite-loops-taken.js ('k') | test/mjsunit/es6/array-tostring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698