From 0ed86c76239d4f2904ea4ae1a77902a9e0db2a6d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2016 12:07:18 +0200 Subject: Move old tests to old-tests/ --- old-tests/if-else/buildfile | 158 ++++++++++++++++++++++++++++++++++++++++++++ old-tests/if-else/test.out | 16 +++++ old-tests/if-else/test.sh | 3 + 3 files changed, 177 insertions(+) create mode 100644 old-tests/if-else/buildfile create mode 100644 old-tests/if-else/test.out create mode 100755 old-tests/if-else/test.sh (limited to 'old-tests/if-else') diff --git a/old-tests/if-else/buildfile b/old-tests/if-else/buildfile new file mode 100644 index 0000000..25fabf0 --- /dev/null +++ b/old-tests/if-else/buildfile @@ -0,0 +1,158 @@ +#else # else without if +#elif # elif without if +#elif! # elif! without if +#if # expected if-expression +#if test # expected true or false +#if true # expected { +#x +#if true # expected newline after { +#{x +#if true # expected newline after } +#{ +#}x + +if true +{ + print 1 +} +else +{ + print 0 +} + +if! true +{ + print 0 +} +else +{ + print 1 +} + +if false +{ + print 0 +} +else +{ + print 1 +} + +if false +{ + print 0 +} +elif true +{ + print 1 +} +else +{ + print 0 +} + +if true +{ + print 1 +} +elif true +{ + print 0 +} +else +{ + print 0 +} + +# Empty block +# +if true +{ +} +else +{ + print 0 +} + +# Nested if-else +# +if true +{ + if true + { + print 1 + } +} +else +{ + if true + { + print 0 + } +} + +t = true +f = false + +if $t +{ + print 1 +} + +if! $f +{ + print 1 +} + +# With eval context. +# +if (foo == foo) +{ + print 1 +} + +if(foo != bar) +{ + print 1 +} + +if!(foo == bar) +{ + print 1 +} + +if ([uint64] 01 == [uint64] 1) +{ + print 1 +} + +# Single line. +# + +#if true +#} # expected if-line + +if true + print 1 + +if false + + print 0 +else + # Comment. + print 1 + +if true + if false + print 0 + else + print 1 + +# EOF test. +# +./: + +if true +{ + print 1 +} diff --git a/old-tests/if-else/test.out b/old-tests/if-else/test.out new file mode 100644 index 0000000..58501cb --- /dev/null +++ b/old-tests/if-else/test.out @@ -0,0 +1,16 @@ +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/old-tests/if-else/test.sh b/old-tests/if-else/test.sh new file mode 100755 index 0000000..c745b76 --- /dev/null +++ b/old-tests/if-else/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +b -q | diff --strip-trailing-cr -u test.out - -- cgit v1.1