From c918f33c44f660116a09c5ee3db44b6a70c26269 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 5 Dec 2020 21:42:21 +0300 Subject: Complete options file path using referencing file path as base --- cli-tests/file/testscript | 84 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 16 deletions(-) (limited to 'cli-tests') diff --git a/cli-tests/file/testscript b/cli-tests/file/testscript index d86ec1d..6f83f91 100644 --- a/cli-tests/file/testscript +++ b/cli-tests/file/testscript @@ -17,10 +17,7 @@ EOI -b 21 EOI -# @@ Give tests some meaningfull descriptions. -# - -: 000 +: with-spaces : cat <=test.ops; -a 11 @@ -51,7 +48,7 @@ a b EOO -: 001 +: empty : cat <=test.ops; # Empty options file. @@ -67,7 +64,7 @@ test.ops b EOO -: 002 +: non-empty-empty : cat <=test.ops; -a 11 @@ -98,7 +95,7 @@ a b EOO -: 003 +: non-existent : $* -a 1 --file ../base.ops --file test.ops b >>EOO 2>>EOE -a @@ -111,7 +108,7 @@ EOO unable to open file 'test.ops' or read failure EOE -: 004 +: quoted : cat <=test.ops; -a a"b"c @@ -167,7 +164,7 @@ a'b " EOO -: 005 +: unmatched-double-quote1 : cat <=test.ops; -a " @@ -176,7 +173,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument '"' EOE -: 006 +: unmatched-double-quote2 : cat <=test.ops; -a "abc @@ -185,7 +182,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument '"abc' EOE -: 007 +: unmatched-double-quote3 : cat <=test.ops; -a abc" @@ -194,7 +191,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument 'abc"' EOE -: 008 +: unmatched-quote1 : cat <=test.ops; -a ' @@ -203,7 +200,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument ''' EOE -: 009 +: unmatched-quote2 : cat <=test.ops; -a 'abc @@ -212,7 +209,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument ''abc' EOE -: 010 +: unmatched-quote3 : cat <=test.ops; -a abc' @@ -221,7 +218,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument 'abc'' EOE -: 011 +: unmatched-quote4 : cat <=test.ops; -a "abc' @@ -230,7 +227,7 @@ $* --file test.ops 2>>EOE unmatched quote in argument '"abc'' EOE -: 012 +: unmatched-quote5 : cat <=test.ops; -a 'abc" @@ -284,3 +281,58 @@ $* ---- test.ops >>EOO -a 123 EOO + +: relativeness +: +{ + +cat <=test1.ops + -a 11 + --file test/test.ops + EOI + + +cat <<"EOI" >=test2.ops + -a 11 + --file $~/test/test.ops + EOI + + +mkdir test + +cat <=test/test.ops + -b 22 + EOI + + : relative + : + $* --file ../test1.ops >>EOO + -a + 11 + -b + 22 + EOO + + : absolute + : + $* --file ../test2.ops >>EOO + -a + 11 + -b + 22 + EOO + + : relative-against-absolute + : + $* --file $~/../test1.ops >>EOO + -a + 11 + -b + 22 + EOO + + : relative-against-normalized + : + $* --file $path.normalize($~/../test1).ops >>EOO + -a + 11 + -b + 22 + EOO +} -- cgit v1.1