Improved Windows compatibility
All checks were successful
/ test (push) Successful in 13s

This commit is contained in:
Eduard Urbach 2025-06-19 18:24:48 +02:00
parent b7fdd56a8b
commit adfcd4b60c
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
2 changed files with 4 additions and 2 deletions

View file

@ -59,7 +59,7 @@ func (e *FileError) Path() string {
return e.file.Path
}
return relative
return filepath.ToSlash(relative)
}
// Unwrap returns the wrapped error.

View file

@ -1,6 +1,7 @@
package errors_test
import (
"bytes"
"io"
"os"
"path/filepath"
@ -37,7 +38,8 @@ func test(t *testing.T, path string) *errors.FileError {
Tokens: tokens,
}
err := errors.New(io.EOF, file, 11)
main := token.Position(bytes.Index(contents, []byte("main()")))
err := errors.New(io.EOF, file, main)
assert.NotNil(t, err)
line, column := err.LineColumn()