grub_script_if.in 980 B

1234567891011121314151617181920212223242526272829303132
  1. #! @builddir@/grub-shell-tester
  2. #basic if, execute
  3. if true; then echo yes; fi
  4. #basic if, no execution
  5. if false; then echo no; fi
  6. #if else, execute if path
  7. if true; then echo yes; else echo no; fi
  8. #if else, execute else path
  9. if false; then echo no; else echo yes; fi
  10. #if elif, execute elif
  11. if false; then echo no; elif true; then echo yes; fi
  12. #if elif else, execute else
  13. if false; then echo no; elif false; then echo no; else echo yes; fi
  14. #if elif(1) elif(2), execute elif(2)
  15. if false; then echo no; elif false; then echo no; elif true; then echo yes; fi
  16. #if elif(1) elif(2) else, execute else
  17. if false; then echo no; elif false; then echo no; elif false; then echo no; else echo yes; fi
  18. #if {if elif else}, execute elif
  19. if true; then if false; then echo no; elif true; then echo yes; else echo no; fi; fi
  20. #if {if elif} else, execute elif. ofcourse no dangling-else problem due to "fi"
  21. if true; then if false; then echo no; elif true; then echo yes; fi; else echo no; fi