diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-09-03 16:37:32 +0200 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-09-04 16:29:59 +0300 |
commit | 5007870b52aa549971824959a55ad3bb886f09e0 (patch) | |
tree | b0ef7f24c0b9ece2ed23f3c1792f16da324e4171 /tests/name/cross.testscript | |
parent | 09d60452a80d14d9b8bf3a9395860b50683fa1e8 (diff) |
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/name/cross.testscript')
-rw-r--r-- | tests/name/cross.testscript | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/tests/name/cross.testscript b/tests/name/cross.testscript new file mode 100644 index 0000000..d625a2c --- /dev/null +++ b/tests/name/cross.testscript @@ -0,0 +1,115 @@ +# file : tests/name/cross.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include ../common.testscript + ++cat <<EOI >=build/root.build +define foo: file +define bar: file + +foo{*}: extension = foo +bar{*}: extension = bar +EOI + +: separation +: +{ + $* <'print fox/ {bar baz}' >'fox/ bar baz' : dir + $* <'print foo {bar baz}' >'foo bar baz' : type + $* <'print fox/foo {bar baz}' >'fox/foo bar baz' : dir-type +} + +: type +: +{ + $* <'print {}{bar}' >'bar' + $* <'print {foo}{}' >'foo{}' + $* <'print {foo}{bar}' >'foo{bar}' + $* <'print {foo}{bar baz}' >'foo{bar} foo{baz}' + $* <'print {foo fox}{bar}' >'foo{bar} fox{bar}' + $* <'print {foo fox}{bar baz}' >'foo{bar} foo{baz} fox{bar} fox{baz}' +} + +: dir +: +{ + $* <'print dir/{}{bar}' >'dir/bar' + $* <'print dir/{foo}{}' >'foo{dir/}' + $* <'print dir/{foo}{bar}' >'dir/foo{bar}' + $* <'print dir/{foo}{bar baz}' >'dir/foo{bar} dir/foo{baz}' + $* <'print dir/{foo fox}{bar}' >'dir/foo{bar} dir/fox{bar}' + $* <'print dir/{foo fox}{bar baz}' >'dir/foo{bar} dir/foo{baz} dir/fox{bar} dir/fox{baz}' + + $* <'print {dir/}{bar}' >'dir/bar' + $* <'print {dir/}{bar baz}' >'dir/bar dir/baz' + $* <'print {dir/ dor/}{bar}' >'dir/bar dor/bar' + $* <'print {dir/ dor/}{bar baz}' >'dir/bar dir/baz dor/bar dor/baz' +} + +: dir-type +: +{ + $* <'print {dir/foo}{bar}' >'dir/foo{bar}' + $* <'print {dir/foo}{bar baz}' >'dir/foo{bar} dir/foo{baz}' + $* <'print {dir/foo dor/fox}{bar}' >'dir/foo{bar} dor/fox{bar}' + $* <'print {dir/foo dor/fox}{bar baz}' >'dir/foo{bar} dir/foo{baz} dor/fox{bar} dor/fox{baz}' + + $* <'print {dir/}{foo}{bar}' >'dir/foo{bar}' + $* <'print {dir/}{foo}{bar baz}' >'dir/foo{bar} dir/foo{baz}' + $* <'print {dir/ dor/}{foo}{bar}' >'dir/foo{bar} dor/foo{bar}' + $* <'print {dir/ dor/}{foo fox}{bar baz}' >'dir/foo{bar} dir/foo{baz} dir/fox{bar} dir/fox{baz} dor/foo{bar} dor/foo{baz} dor/fox{bar} dor/fox{baz}' +} + +: proj +: +{ + $* <'print {prj%foo}{bar baz}' >'prj%foo{bar} prj%foo{baz}' + $* <'print {foo}{bar prj%baz}' >'foo{bar} prj%foo{baz}' + + $* <'print {prj%foo}{bar prk%baz}' 2>>EOE != 0 + <stdin>:1:21: error: nested project name prk + EOE +} + +: merge +: +{ + $* <'print {foo}{bar dir/{baz}}' >'foo{bar} dir/foo{baz}' + $* <'print dir/{foo}{bar dor/{baz}}' >'dir/foo{bar} dir/dor/foo{baz}' + + $* <'print {dir/foo{}}{bar}' >'dir/foo{bar}' + $* <'print {dir/{foo}}{bar}' >'dir/foo{bar}' + $* <'print {dir/}{foo{bar}}' >'dir/foo{bar}' + + $* <'print {dir/foo{fox}}{bar}' 2>>EOE != 0 + <stdin>:1:22: error: nested type name fox + EOE + + $* <'print {dir/foo}{fox{bar}}' 2>>EOE != 0 + <stdin>:1:20: error: nested type name fox + EOE +} + +: pair +: +{ + $* <'print x@{dir/ dor/}{foo fox}{bar baz}' >'x@dir/foo{bar} x@dir/foo{baz} x@dir/fox{bar} x@dir/fox{baz} x@dor/foo{bar} x@dor/foo{baz} x@dor/fox{bar} x@dor/fox{baz}' +} + +: pattern +: +{ + touch x.foo y.bar; + $* <'print {foo bar}{*}' >'foo{x} bar{y}' + + mkdir dir && touch dir/x.foo; + $* <'print {*/}{*.foo}' >/'dir/x.foo' + + mkdir dir && touch dir/x.foo; + $* <'print {*/}{foo}{*}' >/'dir/foo{x}' +} + +# @@ TODO: nested replay. +# +#file{foo} file{bar}: x = {foo fox}{bar baz} |