File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ setUp () {
4+ rm test* .yml || true
5+
6+ }
7+
8+ testLineCountFirstLineComment () {
9+ cat > test.yml << EOL
10+ #test123
11+ abc: 123
12+ test123: 123123
13+ #comment
14+ lalilu: lalilu
15+ EOL
16+
17+ X=$( ./yq ' .lalilu | line' --header-preprocess=false < test.yml)
18+ assertEquals " 5" " $X "
19+ }
20+
21+ testArrayOfDocs () {
22+ cat > test.yml << EOL
23+ ---
24+ # leading comment doc 1
25+ a: 1
26+ ---
27+ # leading comment doc 2
28+ a: 2
29+ EOL
30+
31+ read -r -d ' ' expected << EOM
32+ - # leading comment doc 1
33+ a: 1
34+ - # leading comment doc 2
35+ a: 2
36+ EOM
37+
38+ X=$( ./yq ea ' [.]' --header-preprocess=false < test.yml)
39+ assertEquals " $expected " " $X "
40+
41+ }
42+
43+ source ./scripts/shunit2
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+
4+ # examples where header-preprocess is required
5+
36setUp () {
47 rm test* .yml || true
58 cat > test.yml << EOL
You can’t perform that action at this time.
0 commit comments