Skip to content

Commit 0156c14

Browse files
committed
test: Add tests for 'ocitools generate' and --output
Signed-off-by: W. Trevor King <[email protected]>
1 parent 8cacd9e commit 0156c14

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

test/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ And read the `Makefile` source to find other useful targets
2121

2222
0 - Global ocitools options.
2323

24+
1 - `ocitools generate`.
25+
2426
## Dependencies
2527

2628
* [GNU Core Utilities][coreutils] for [`cat`][cat.1],

test/t1000-generate-output.t

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
test_description='Test generate output'
4+
5+
. ./sharness.sh
6+
7+
test_expect_success CAT,HEAD 'Test ocitools generate writing to stdout' "
8+
ocitools generate | head -n2 >actual &&
9+
cat <<EOF >expected &&
10+
{
11+
\"ociVersion\": \"1.0.0-rc1\",
12+
EOF
13+
test_cmp expected actual
14+
"
15+
16+
test_expect_success CAT,HEAD 'Test ocitools generate --output' "
17+
ocitools generate --output config.json &&
18+
head -n2 config.json >actual &&
19+
cat <<EOF >expected &&
20+
{
21+
\"ociVersion\": \"1.0.0-rc1\",
22+
EOF
23+
test_cmp expected actual
24+
"
25+
26+
test_done

0 commit comments

Comments
 (0)