File tree 5 files changed +19
-23
lines changed
5 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ test*.yml
44
44
test * .xml
45
45
test * .toml
46
46
test * .yaml
47
+ test_dir1 /
48
+ test_dir2 /
47
49
0.yml
48
50
1.yml
49
51
2.yml
Original file line number Diff line number Diff line change @@ -207,21 +207,21 @@ EOM
207
207
208
208
testSplitWithDirectories () {
209
209
cat > test.yml << EOL
210
- f: test_dir1/file1
210
+ f: test_dir1/test_file1
211
211
---
212
- f: test_dir2/dir22/file2
212
+ f: test_dir2/dir22/test_file2
213
213
---
214
- f: file3
214
+ f: test_file3
215
215
EOL
216
216
217
217
./yq e --no-doc -s " .f" test.yml
218
218
219
- doc1=$( cat test_dir1/file1 .yml)
220
- assertEquals " f: test_dir1/file1 " " $doc1 "
221
- doc2=$( cat test_dir2/dir22/file2 .yml)
222
- assertEquals " f: test_dir2/dir22/file2 " " $doc2 "
223
- doc3=$( cat file3 .yml)
224
- assertEquals " f: file3 " " $doc3 "
219
+ doc1=$( cat test_dir1/test_file1 .yml)
220
+ assertEquals " f: test_dir1/test_file1 " " $doc1 "
221
+ doc2=$( cat test_dir2/dir22/test_file2 .yml)
222
+ assertEquals " f: test_dir2/dir22/test_file2 " " $doc2 "
223
+ doc3=$( cat test_file3 .yml)
224
+ assertEquals " f: test_file3 " " $doc3 "
225
225
}
226
226
227
227
source ./scripts/shunit2
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ require (
8
8
github.com/elliotchance/orderedmap v1.7.1
9
9
github.com/fatih/color v1.18.0
10
10
github.com/goccy/go-json v0.10.4
11
- github.com/goccy/go-yaml v1.13.0
11
+ github.com/goccy/go-yaml v1.13.3
12
12
github.com/jinzhu/copier v0.4.0
13
13
github.com/magiconair/properties v1.8.9
14
14
github.com/pelletier/go-toml/v2 v2.2.3
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27
26
26
github.com/go-playground/validator/v10 v10.22.1 /go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM =
27
27
github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM =
28
28
github.com/goccy/go-json v0.10.4 /go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M =
29
- github.com/goccy/go-yaml v1.13.0 h1:0Wtp0FZLd7Sm8gERmR9S6Iczzb3vItJj7NaHmFg8pTs =
30
- github.com/goccy/go-yaml v1.13.0 /go.mod h1:IjYwxUiJDoqpx2RmbdjMUceGHZwYLon3sfOGl5Hi9lc =
29
+ github.com/goccy/go-yaml v1.13.3 h1:IXRULR8mAa0MXQobzzp0VOfMUJ8EnaQ4x3jhf7S0/nI =
30
+ github.com/goccy/go-yaml v1.13.3 /go.mod h1:IjYwxUiJDoqpx2RmbdjMUceGHZwYLon3sfOGl5Hi9lc =
31
31
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI =
32
32
github.com/google/go-cmp v0.6.0 /go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY =
33
33
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM =
Original file line number Diff line number Diff line change @@ -20,17 +20,11 @@ var goccyYamlFormatScenarios = []formatScenario{
20
20
expected : "3.1\n " ,
21
21
},
22
22
{
23
- description : "basic - 3.1 " ,
23
+ description : "basic - mike " ,
24
24
skipDoc : true ,
25
25
input : "mike: 3" ,
26
26
expected : "mike: 3\n " ,
27
27
},
28
- {
29
- description : "basic - 3.1" ,
30
- skipDoc : true ,
31
- input : "{mike: 3}" ,
32
- expected : "{mike: 3}\n " ,
33
- },
34
28
{
35
29
description : "basic - map multiple entries" ,
36
30
skipDoc : true ,
@@ -40,23 +34,23 @@ var goccyYamlFormatScenarios = []formatScenario{
40
34
{
41
35
description : "basic - 3.1" ,
42
36
skipDoc : true ,
43
- input : "{\n mike : 3\n }" ,
37
+ input : "{\n mike : 3\n }" ,
44
38
expected : "{mike: 3}\n " ,
45
39
},
46
40
{
47
- description : "basic - 3.1 " ,
41
+ description : "basic - tag with number " ,
48
42
skipDoc : true ,
49
43
input : "mike: !!cat 3" ,
50
44
expected : "mike: !!cat 3\n " ,
51
45
},
52
46
{
53
- description : "basic - 3.1 " ,
47
+ description : "basic - array of numbers " ,
54
48
skipDoc : true ,
55
49
input : "- 3" ,
56
50
expected : "- 3\n " ,
57
51
},
58
52
{
59
- description : "basic - 3.1 " ,
53
+ description : "basic - single line array " ,
60
54
skipDoc : true ,
61
55
input : "[3]" ,
62
56
expected : "[3]\n " ,
You can’t perform that action at this time.
0 commit comments