blob: 7cf06dae8207119f75cb0193d20586ee65cd5ec7 [file] [log] [blame]
--- RCPTT testcase ---
Format-Version: 1.0
Element-Name: Switch
Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _gKwkEPd7EeOUrIHOddLXDg
Runtime-Version: 1.5.2.201408180747
Save-Time: 8/28/14 2:24 PM
Testcase-Type: ecl
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
Content-Type: text/ecl
Entry-Name: .content
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=442016
switch foo
[case foo { bool true }]
-default { bool false } | assert-true
// 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--