Skip to content

Commit

Permalink
Fix go version
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuniwak committed Apr 17, 2024
1 parent de33145 commit 37b37f1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tool/unity-meta-check-junit/junit/junit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package junit

import (
"bytes"
"fmt"
"github.com/DeNA/unity-meta-check/unity/checker"
"github.com/DeNA/unity-meta-check/util/typedpath"
"github.com/google/go-cmp/cmp"
"runtime"
"testing"
)

Expand All @@ -15,16 +17,16 @@ func TestWrite(t *testing.T) {
}{
"empty (boundary)": {
Result: checker.NewCheckResult([]typedpath.SlashPath{}, []typedpath.SlashPath{}),
Expected: `<?xml version="1.0" encoding="UTF-8"?>
Expected: fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="1" failures="0" time="0.000" name="unity-meta-check">
<properties>
<property name="go.version" value="go1.22.0"></property>
<property name="go.version" value="%s"></property>
</properties>
<testcase classname="unity-meta-check" name="OK" time="0.000"></testcase>
</testsuite>
</testsuites>
`,
`, runtime.Version()),
},
"both missing and dangling (easy to test)": {
Result: checker.NewCheckResult(
Expand All @@ -35,26 +37,26 @@ func TestWrite(t *testing.T) {
typedpath.NewSlashPathUnsafe("path/to/dangling.meta"),
},
),
Expected: `<?xml version="1.0" encoding="UTF-8"?>
Expected: fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="1" failures="1" time="0.000" name="path/to/missing" file="path/to/missing">
<properties>
<property name="go.version" value="go1.22.0"></property>
<property name="go.version" value="%s"></property>
</properties>
<testcase classname="missing" name="meta" time="0.000" file="path/to/missing">
<failure message="Failed" type="">File or directory exists: path/to/missing&#xA;But .meta is missing: path/to/missing.meta</failure>
</testcase>
</testsuite>
<testsuite tests="1" failures="1" time="0.000" name="path/to/dangling" file="path/to/dangling">
<properties>
<property name="go.version" value="go1.22.0"></property>
<property name="go.version" value="%s"></property>
</properties>
<testcase classname="dangling" name="meta" time="0.000" file="path/to/dangling">
<failure message="Failed" type="">File or directory does not exist: path/to/dangling&#xA;But .meta is present: path/to/dangling.meta</failure>
</testcase>
</testsuite>
</testsuites>
`,
`, runtime.Version(), runtime.Version()),
},
}

Expand Down

0 comments on commit 37b37f1

Please sign in to comment.