Compute the version number dynamically
[muddle-interpreter.git] / src / test_bindings
1 #!/bin/sh
2
3 # Copyright (C) 2018 Keziah Wesley
4
5 # You can redistribute and/or modify this file under the terms of the
6 # GNU Affero General Public License as published by the Free Software
7 # Foundation, either version 3 of the License, or (at your option) any
8 # later version.
9
10 # This file is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public
16 # License along with this file. If not, see
17 # <http://www.gnu.org/licenses/>.
18
19 assert_eq () {
20     [ "$1" = "$2" ] || ( echo Assertion failed: "\"$1\"" = "\"$2\""; exit 1 )
21 }
22
23 assert_eq 'ROOT' "$(echo '<SETG BAZ ROOT>' | ./muddle)"
24 assert_eq '(ROOT BAZ)' "$(echo '(<SETG BAZ ROOT> BAZ)' | ./muddle)"
25 assert_eq '(ROOT ROOT)' "$(echo '(<SETG BAZ ROOT> <GVAL BAZ>)' | ./muddle)"