diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec368b6..abf6360 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,31 +1,27 @@ { "name": "go test", - "on": ["push", "pull_request"], + "on": ["push"], "jobs": { "test": { "strategy": { "matrix": { - "go-version": ["1.18.x", "1.21.x"], + "go-version": ["1.18.x", "1.22.x"], "os": ["ubuntu-latest", "macos-latest", "windows-latest"] } }, "runs-on": "${{ matrix.os }}", "steps": [ { - "name": "Install Go", - "uses": "actions/setup-go@v2", + "uses": "actions/setup-go@v5", "with": {"go-version": "${{ matrix.go-version }}"} }, { - "name": "Checkout code", - "uses": "actions/checkout@v2" + "uses": "actions/checkout@v4" }, { - "name": "Test", "run": "go test -v ./..." }, { - "name": "Install", "run": "go install -v ./cmd/toml-test" } ] diff --git a/go.mod b/go.mod index c46ceff..6d589bd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/toml-lang/toml-test go 1.18 require ( - github.com/BurntSushi/toml v1.3.3-0.20231207130039-4223137ff1f9 + github.com/BurntSushi/toml v1.3.3-0.20240103001115-0e879cbdab10 // no_term branch, which doesn't depend on x/term and x/sys zgo.at/zli v0.0.0-20231011155724-865ee344d4b3 ) diff --git a/go.sum b/go.sum index 1121976..2f20b8c 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/BurntSushi/toml v1.3.3-0.20231207130039-4223137ff1f9 h1:lcDxyXwPxaYMIsFHL6UR/fzQouvVdaKpZh8zZRN+KlA= -github.com/BurntSushi/toml v1.3.3-0.20231207130039-4223137ff1f9/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.3.3-0.20240103001115-0e879cbdab10 h1:HfOzWIEwtJGprgjAGJdf0WSvoTaSU+tb4nIjGn4SKlA= +github.com/BurntSushi/toml v1.3.3-0.20240103001115-0e879cbdab10/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= zgo.at/zli v0.0.0-20231011155724-865ee344d4b3 h1:c6mOqJByLZGs0hmCK0Pr+XuDU6XoNcccUROX/8nPP6g= zgo.at/zli v0.0.0-20231011155724-865ee344d4b3/go.mod h1:HLAc12TjNGT+VRXr76JnsNE3pbooQtwKWhX+RlDjQ2Y= diff --git a/toml_test.go b/toml_test.go index 9aa6fa8..7554141 100644 --- a/toml_test.go +++ b/toml_test.go @@ -123,12 +123,7 @@ func TestSize(t *testing.T) { if err != nil { return err } - - inf, err := d.Info() - if err != nil { - return err - } - if inf.IsDir() { + if d.IsDir() { return nil } if strings.Contains(path, "/spec-") || strings.Contains(path, "/spec/") { @@ -138,8 +133,15 @@ func TestSize(t *testing.T) { return nil } - if inf.Size() > 1024 { - t.Errorf("larger than 1K: %s (%fK)", path, float64(inf.Size())/1024) + // Don't use FileInfo.Size() as that reports inconsistent results on + // different platforms. + data, err := fs.ReadFile(EmbeddedTests(), path) + if err != nil { + return err + } + if l := len(data); l > 1024 { + data, _ := fs.ReadFile(EmbeddedTests(), path) + t.Errorf("larger than 1K: %s (%fK)\n%v", path, float64(l)/1024, data) } return nil })