Skip to content

Commit

Permalink
Bumping goccy
Browse files Browse the repository at this point in the history
  • Loading branch information
mikefarah committed Jan 12, 2025
1 parent 31ad7fb commit 0f390b2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ test*.yml
test*.xml
test*.toml
test*.yaml
test_dir1/
test_dir2/
0.yml
1.yml
2.yml
Expand Down
18 changes: 9 additions & 9 deletions acceptance_tests/split-printer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,21 @@ EOM

testSplitWithDirectories() {
cat >test.yml <<EOL
f: test_dir1/file1
f: test_dir1/test_file1
---
f: test_dir2/dir22/file2
f: test_dir2/dir22/test_file2
---
f: file3
f: test_file3
EOL

./yq e --no-doc -s ".f" test.yml

doc1=$(cat test_dir1/file1.yml)
assertEquals "f: test_dir1/file1" "$doc1"
doc2=$(cat test_dir2/dir22/file2.yml)
assertEquals "f: test_dir2/dir22/file2" "$doc2"
doc3=$(cat file3.yml)
assertEquals "f: file3" "$doc3"
doc1=$(cat test_dir1/test_file1.yml)
assertEquals "f: test_dir1/test_file1" "$doc1"
doc2=$(cat test_dir2/dir22/test_file2.yml)
assertEquals "f: test_dir2/dir22/test_file2" "$doc2"
doc3=$(cat test_file3.yml)
assertEquals "f: test_file3" "$doc3"
}

source ./scripts/shunit2
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/elliotchance/orderedmap v1.7.1
github.com/fatih/color v1.18.0
github.com/goccy/go-json v0.10.4
github.com/goccy/go-yaml v1.13.0
github.com/goccy/go-yaml v1.13.3
github.com/jinzhu/copier v0.4.0
github.com/magiconair/properties v1.8.9
github.com/pelletier/go-toml/v2 v2.2.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM=
github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/goccy/go-yaml v1.13.0 h1:0Wtp0FZLd7Sm8gERmR9S6Iczzb3vItJj7NaHmFg8pTs=
github.com/goccy/go-yaml v1.13.0/go.mod h1:IjYwxUiJDoqpx2RmbdjMUceGHZwYLon3sfOGl5Hi9lc=
github.com/goccy/go-yaml v1.13.3 h1:IXRULR8mAa0MXQobzzp0VOfMUJ8EnaQ4x3jhf7S0/nI=
github.com/goccy/go-yaml v1.13.3/go.mod h1:IjYwxUiJDoqpx2RmbdjMUceGHZwYLon3sfOGl5Hi9lc=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
Expand Down
16 changes: 5 additions & 11 deletions pkg/yqlib/goccy_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ var goccyYamlFormatScenarios = []formatScenario{
expected: "3.1\n",
},
{
description: "basic - 3.1",
description: "basic - mike",
skipDoc: true,
input: "mike: 3",
expected: "mike: 3\n",
},
{
description: "basic - 3.1",
skipDoc: true,
input: "{mike: 3}",
expected: "{mike: 3}\n",
},
{
description: "basic - map multiple entries",
skipDoc: true,
Expand All @@ -40,23 +34,23 @@ var goccyYamlFormatScenarios = []formatScenario{
{
description: "basic - 3.1",
skipDoc: true,
input: "{\nmike: 3\n}",
input: "{\n mike: 3\n}",
expected: "{mike: 3}\n",
},
{
description: "basic - 3.1",
description: "basic - tag with number",
skipDoc: true,
input: "mike: !!cat 3",
expected: "mike: !!cat 3\n",
},
{
description: "basic - 3.1",
description: "basic - array of numbers",
skipDoc: true,
input: "- 3",
expected: "- 3\n",
},
{
description: "basic - 3.1",
description: "basic - single line array",
skipDoc: true,
input: "[3]",
expected: "[3]\n",
Expand Down

0 comments on commit 0f390b2

Please sign in to comment.