From cf18da3ac461087ccffd31222dbe4fa2e6428d56 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Nov 2019 14:58:11 +0200 Subject: Fix tests --- tests/function/builtin/testscript | 1 + tests/function/filesystem/testscript | 3 +++ tests/function/install/testscript | 1 + tests/function/path/testscript | 2 ++ tests/function/regex/testscript | 21 +++++++++++++++++---- 5 files changed, 24 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/function/builtin/testscript b/tests/function/builtin/testscript index 7b85d7b..46a7b2c 100644 --- a/tests/function/builtin/testscript +++ b/tests/function/builtin/testscript @@ -105,6 +105,7 @@ : $* <'print $getenv(a b)' 2>>EOE != 0 error: invalid argument: invalid string value: multiple names + :1:8: info: while calling getenv() EOE } diff --git a/tests/function/filesystem/testscript b/tests/function/filesystem/testscript index 41d4c59..1b65d50 100644 --- a/tests/function/filesystem/testscript +++ b/tests/function/filesystem/testscript @@ -23,6 +23,7 @@ $* <'print $path_search([path] "b**/", [dir_path] ../../a)' 2>>~%EOE% != 0 %error: start directory '.+' is relative% % info: pattern '.+' is relative% + :1:8: info: while calling path_search(path, dir_path) EOE : start-untyped @@ -33,6 +34,7 @@ : $* <'print $path_search([path] "b**/", a b)' 2>>EOE != 0 error: invalid argument: invalid dir_path value: multiple names + :1:8: info: while calling path_search(path, ) EOE } @@ -68,6 +70,7 @@ touch b; $* <'print $path_search(a b, $src_base)' 2>>EOE != 0 error: invalid argument: invalid path value: multiple names + :1:8: info: while calling path_search(, dir_path) EOE } } diff --git a/tests/function/install/testscript b/tests/function/install/testscript index 99cf826..1341a1a 100644 --- a/tests/function/install/testscript +++ b/tests/function/install/testscript @@ -29,5 +29,6 @@ EOI $* <'print $install.resolve([dir_path] foo/a)' 2>>EOE != 0 error: unknown installation directory name 'foo' info: did you forget to specify config.install.foo? + :1:8: info: while calling install.resolve(dir_path) EOE } diff --git a/tests/function/path/testscript b/tests/function/path/testscript index 8059f05..742ec21 100644 --- a/tests/function/path/testscript +++ b/tests/function/path/testscript @@ -72,6 +72,7 @@ s = ($cxx.target.class != 'windows' ? '/' : '\') : $* <'print $leaf([path] a/b/c, [dir_path] a/d)' 2>>"EOE" != 0 error: 'a/d$s' is not a prefix of 'a/b/c' + :1:8: info: while calling leaf\(path, dir_path\) EOE } @@ -106,6 +107,7 @@ s = ($cxx.target.class != 'windows' ? '/' : '\') p = ($cxx.target.class != 'windows' ? /../foo : 'c:/../foo'); $* <"\$path.normalize\('$p')" 2>>"EOE" != 0 error: invalid path: '$p' + :1:2: info: while calling path.normalize\(\) EOE : path-match diff --git a/tests/function/regex/testscript b/tests/function/regex/testscript index 1fdb383..6ee4c4d 100644 --- a/tests/function/regex/testscript +++ b/tests/function/regex/testscript @@ -42,21 +42,30 @@ : multiple-names : - $* <'error: invalid argument: invalid string value: multiple names' != 0 + $* <>EOE != 0 print $regex.replace(foo.cxx bar.cxx, '([^.]*)', '\1.o') EOI + error: invalid argument: invalid string value: multiple names + :1:8: info: while calling regex.replace(, , ) + EOE : null : - $* <'error: invalid argument: null value' != 0 + $* <>EOE != 0 print $regex.replace([null], '([^.]*)', '\1.o') EOI + error: invalid argument: null value + :1:8: info: while calling regex.replace(, , ) + EOE : null-regex : - $* <'error: invalid argument: null value' != 0 + $* <>EOE != 0 print $regex.replace(foo.cxx, [null], '\1.o') EOI + error: invalid argument: null value + :1:8: info: while calling regex.replace(, , ) + EOE } : no-subs @@ -104,15 +113,19 @@ : unknown : - $* <"error: invalid argument: invalid flag 'unknown'" != 0 + $* <>EOE != 0 print $regex.replace("foo.cxx", '(f[^.]*).*', '\1.o', unknown) EOI + error: invalid argument: invalid flag 'unknown' + :1:8: info: while calling regex.replace(, , , ) + EOE } : invalid-regex : $* <'print $regex.replace(a, "[", b)' 2>>~/EOE/ != 0 /error: invalid argument: invalid regex '\['.*/ + :1:8: info: while calling regex.replace(, , ) EOE } -- cgit v1.1