blob: d00dbbd82acc59560a66ea818254e03d1df89d06 [file] [log] [blame]
--- RCPTT testcase ---
Format-Version: 1.0
Q7-vendor: www.xored.com/q7
Element-Name: Switch
Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _gKwkEPd7EeOUrIHOddLXDg
Q7-Runtime-Version: 1.5.0.qualifier
Save-Time: 6/19/14 1:45 PM
Testcase-Type: ecl
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
Content-Type: text/ecl
Entry-Name: .content
// Without default
echo "right"
| switch
[case "right" { echo "Correct" }]
[case "not-right" { echo "Not correct" }]
| eq "Correct" | assert-true
echo "right"
| switch
[case "not-right" { echo "Not correct" }]
[case "right" { echo "Correct" }]
| eq "Correct" | assert-true
// With default
echo "right"
| switch
[case "not-right" { echo "Not correct" }]
[case "also-not-right" { echo "Also not correct" }]
-default { echo "Correct" }
| eq "Correct" | assert-true
echo "right"
| switch
[case "right" { echo "Correct" }]
[case "also-not-right" { echo "Also not correct" }]
-default { echo "Not correct" }
| eq "Correct" | assert-true
// With ints
int 1
| switch
[case 1 { echo "Correct" }]
[case 2 { echo "Not correct" }]
-default { echo "Also not correct" }
| equals "Correct" | verify-true
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac--