]>
Commit | Line | Data |
---|---|---|
0f3a3e3e BC |
1 | #! @builddir@/grub-shell-tester |
2 | ||
3 | #basic if, execute | |
4 | if true; then echo yes; fi | |
5 | ||
6 | #basic if, no execution | |
7 | if false; then echo no; fi | |
8 | ||
9 | #if else, execute if path | |
10 | if true; then echo yes; else echo no; fi | |
11 | ||
12 | #if else, execute else path | |
13 | if false; then echo no; else echo yes; fi | |
14 | ||
15 | #if elif, execute elif | |
16 | if false; then echo no; elif true; then echo yes; fi | |
17 | ||
18 | #if elif else, execute else | |
19 | if false; then echo no; elif false; then echo no; else echo yes; fi | |
20 | ||
21 | #if elif(1) elif(2), execute elif(2) | |
22 | if false; then echo no; elif false; then echo no; elif true; then echo yes; fi | |
23 | ||
24 | #if elif(1) elif(2) else, execute else | |
25 | if false; then echo no; elif false; then echo no; elif false; then echo no; else echo yes; fi | |
26 | ||
27 | #if {if elif else}, execute elif | |
28 | if true; then if false; then echo no; elif true; then echo yes; else echo no; fi; fi | |
29 | ||
30 | #if {if elif} else, execute elif. ofcourse no dangling-else problem due to "fi" | |
31 | if true; then if false; then echo no; elif true; then echo yes; fi; else echo no; fi |