Skip to content

Commit

Permalink
Add some flag-related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed Aug 10, 2014
1 parent a09887e commit 9043195
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
39 changes: 39 additions & 0 deletions t/cmd_flags
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
for a in . .. ../.. ; do [ -e $a/tests.sh ] && . $a/tests.sh ; done

NAME='no flags'
CMDS='f
'
EXPECT=''
run_test

NAME='Set/get'
CMDS='
f cat
f rimmer 12
f lister 32@666
f kryten 32 666
f+skutter 1 @ 12
f
'
EXPECT='0x0000000c 1 skutter
0x0000029a 32 kryten
0x0000029a 32 lister
0x00000000 12 rimmer
0x00000000 1 cat
'
run_test

NAME='flags (JSON)'
CMDS='
# Add flags.
f cat
f rimmer 12
f lister 32@666
f kryten 32 666
f+skutter 1 @ 12
fj
'
EXPECT='[{"name":"skutter","size":"1","offset":12},{"name":"kryten","size":"32","offset":666},{"name":"lister","size":"32","offset":666},{"name":"rimmer","size":"12","offset":0},{"name":"cat","size":"1","offset":0}]
'
run_test
23 changes: 0 additions & 23 deletions t/flags/getset

This file was deleted.

0 comments on commit 9043195

Please sign in to comment.