]> git.proxmox.com Git - grub2.git/blame - tests/grub_script_not.in
* New Bazaar snapshot.
[grub2.git] / tests / grub_script_not.in
CommitLineData
1bce65c7
BC
1#! @builddir@/grub-shell-tester
2#
3# Copyright (C) 2010 Free Software Foundation, Inc.
4#
5# GRUB is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# GRUB is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
17
18true
19echo $?
20
21! true
22echo $?
23
24false
25echo $?
26
27! false
28echo $?
29
30#
31# Negated forms (copied from grub_script_if.in)
32#
33
34#basic if, execute
35if ! true; then echo yes; fi
36
37#basic if, no execution
38if ! false; then echo no; fi
39
40#if else, execute if path
41if ! true; then echo yes; else echo no; fi
42
43#if else, execute else path
44if ! false; then echo no; else echo yes; fi
45
46#if elif, execute elif
47if ! false; then echo no; elif ! true; then echo yes; fi
48
49#if elif else, execute else
50if ! false; then echo no; elif ! false; then echo no; else echo yes; fi
51
52#if elif(1) elif(2), execute elif(2)
53if false; then echo no; elif ! false; then echo no; elif ! true; then echo yes; fi
54
55#if elif(1) elif(2) else, execute else
56if false; then echo no; elif false; then echo no; elif ! false; then echo no; else echo yes; fi
57
58#if {if elif else}, execute elif
59if true; then if false; then echo no; elif ! true; then echo yes; else echo no; fi; fi
60
61#if {if elif} else, execute elif. ofcourse no dangling-else problem due to "fi"
62if true; then if ! false; then echo no; elif true; then echo yes; fi; else echo no; fi