ci-platforms / darwin amd64 smoke (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Failing after 15m28s
ci / release (push) Skipped
ci-platforms / windows amd64 smoke (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
ci / checks (push) Successful in 7m47s
25 lines
456 B
Go
25 lines
456 B
Go
package problems
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"aego/editor/core/context"
|
|
)
|
|
|
|
func TestWhereOmitsUnknownSourcePositions(t *testing.T) {
|
|
for _, tt := range []struct {
|
|
line, col int
|
|
want string
|
|
}{
|
|
{10, 0, "10"},
|
|
{10, -1, "10"},
|
|
{10, 4, "10:4"},
|
|
{0, 0, ""},
|
|
{0, 4, ""},
|
|
} {
|
|
if got := where(&context.ScriptProblem{Line: tt.line, Col: tt.col}); got != tt.want {
|
|
t.Errorf("where(%d, %d) = %q, want %q", tt.line, tt.col, got, tt.want)
|
|
}
|
|
}
|
|
}
|