aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/test/script/parser/scope-if.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-03-06 23:06:30 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-03-08 16:42:31 +0300
commit77410b0cdde47219d6c6a36533fcb9354f17c3dd (patch)
tree703c39f3bc81792fabaf81769035f01a08cf6a2f /unit-tests/test/script/parser/scope-if.testscript
parent8ca10194e206a181797ffb7a73dd2deee12ac753 (diff)
Use new setup for unit tests
Diffstat (limited to 'unit-tests/test/script/parser/scope-if.testscript')
-rw-r--r--unit-tests/test/script/parser/scope-if.testscript554
1 files changed, 0 insertions, 554 deletions
diff --git a/unit-tests/test/script/parser/scope-if.testscript b/unit-tests/test/script/parser/scope-if.testscript
deleted file mode 100644
index 461d902..0000000
--- a/unit-tests/test/script/parser/scope-if.testscript
+++ /dev/null
@@ -1,554 +0,0 @@
-# file : unit-tests/test/script/parser/scope-if.testscript
-# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
-# license : MIT; see accompanying LICENSE file
-
-: if
-:
-{
- : true
- :
- $* -s <<EOI >>EOO
- if true foo
- {
- cmd
- }
- EOI
- {
- ? true foo
- {
- cmd
- }
- }
- EOO
-
- : false
- :
- $* -s <<EOI >>EOO
- if false foo
- {
- cmd
- }
- EOI
- {
- ? false foo
- }
- EOO
-
- : not-true
- :
- $* -s <<EOI >>EOO
- if! true
- {
- cmd
- }
- EOI
- {
- ? true
- }
- EOO
-
- : not-false
- :
- $* -s <<EOI >>EOO
- if! false
- {
- cmd
- }
- EOI
- {
- ? false
- {
- cmd
- }
- }
- EOO
-
- : eos-inside
- :
- $* <<EOI 2>>EOE != 0
- if
- {
- EOI
- testscript:3:1: error: expected '}' at the end of the scope
- EOE
-
-}
-
-: elif
-:
-{
- : true
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif true
- {
- cmd1
- }
- EOI
- {
- ? false
- ? true
- {
- cmd1
- }
- }
- EOO
-
- : false
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif false
- {
- cmd
- }
- EOI
- {
- ? false
- ? false
- }
- EOO
-
- : not-false
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif! false
- {
- cmd1
- }
- EOI
- {
- ? false
- ? false
- {
- cmd1
- }
- }
- EOO
-
- : not-true
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif! true
- {
- cmd
- }
- EOI
- {
- ? false
- ? true
- }
- EOO
-
- : after-else
- :
- $* <<EOI 2>>EOE != 0
- if false
- {
- cmd
- }
- else
- {
- cmd
- }
- elif true
- {
- cmd
- }
- EOI
- testscript:9:1: error: 'elif' after 'else'
- EOE
-}
-
-: else
-:
-{
- : true
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- else
- {
- cmd1
- }
- EOI
- {
- ? false
- {
- cmd1
- }
- }
- EOO
-
- : false
- :
- $* -s <<EOI >>EOO
- if true
- {
- cmd1
- }
- else
- {
- cmd
- }
- EOI
- {
- ? true
- {
- cmd1
- }
- }
- EOO
-
- : chain
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif false
- {
- cmd
- cmd
- }
- elif false
- {
- cmd
- }
- elif true
- {
- cmd1
- cmd2
- }
- elif false
- {
- cmd
- }
- else
- {
- cmd
- cmd
- }
- EOI
- {
- ? false
- ? false
- ? false
- ? true
- {
- {
- cmd1
- }
- {
- cmd2
- }
- }
- }
- EOO
-
- : scope-expected
- :
- $* <<EOI 2>>EOE != 0
- if
- {
- cmd
- }
- else
- cmd
- EOI
- testscript:5:1: error: expected scope after 'else'
- EOE
-
- : after-else
- :
- $* <<EOI 2>>EOE != 0
- if false
- {
- cmd
- }
- else
- {
- cmd
- }
- else
- {
- cmd
- }
- EOI
- testscript:9:1: error: 'else' after 'else'
- EOE
-}
-
-: nested
-:
-{
- : take
- :
- $* -s <<EOI >>EOO
- if true
- {
- cmd1
- if false
- {
- cmd
- }
- elif false
- {
- if true
- {
- cmd
- }
- }
- else
- {
- cmd2
- }
- cmd3
- }
- EOI
- {
- ? true
- {
- {
- cmd1
- }
- ? false
- ? false
- {
- {
- cmd2
- }
- }
- {
- cmd3
- }
- }
- }
- EOO
-
- : skip
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd1
- if false
- {
- cmd
- }
- elif false
- {
- if true
- {
- cmd
- }
- }
- else
- {
- cmd2
- }
- cmd3
- }
- else
- {
- cmd
- }
- EOI
- {
- ? false
- {
- {
- cmd
- }
- }
- }
- EOO
-}
-
-: demote
-:
-{
- : group
- : Chain remains a group
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif true
- {
- cmd1
- cmd2
- }
- else
- {
- cmd
- }
- EOI
- {
- ? false
- ? true
- {
- {
- cmd1
- }
- {
- cmd2
- }
- }
- }
- EOO
-
- : test
- : Chain demoted to test
- :
- $* -s <<EOI >>EOO
- if false
- {
- cmd
- }
- elif true
- {
- cmd1
- }
- else
- {
- cmd
- }
- EOI
- {
- ? false
- ? true
- {
- cmd1
- }
- }
- EOO
-}
-
-: line-index
-: Make sure command line index spans setup/if/teardown
-:
-$* -s -l <<EOI >>EOO
-+setup # 1
-
-if false one # 2
-{
- cmd
-}
-elif false two # 3
-{
- cmd
-}
-elif true # 4
-{
- cmd1
-}
-elif false # 5
-{
- cmd
-}
-else
-{
- cmd
-}
-
-if false one # 6
-{
- cmd
-}
-elif false two # 7
-{
- cmd
-}
-else
-{
- cmd2
-}
-
--tdown # 8
-EOI
-{
- +setup # 1
- ? false one # 2
- ? false two # 3
- ? true # 4
- {
- cmd1 # 0
- }
- ? false one # 6
- ? false two # 7
- {
- cmd2 # 0
- }
- -tdown # 8
-}
-EOO
-
-: scope-comman-if
-:
-$* -s <<EOI >>EOO
-if true
-{
- cmd
-}
-if true
- cmd1
- cmd2
-end
-EOI
-{
- ? true
- {
- cmd
- }
- {
- ? true
- cmd1
- cmd2
- }
-}
-EOO
-
-: shared-id-desc
-:
-$* -s -i <<EOI >>EOO
-: test summary
-:
-if false
-{
- cmd
-}
-else
-{
- cmd1
-}
-EOI
-{
- ? false
- : sm:test summary
- { # 3
- cmd1
- }
-}
-EOO