mirror of
https://github.com/zhigang1992/esbuild.git
synced 2026-01-12 22:46:54 +08:00
25 lines
438 B
Go
25 lines
438 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/evanw/esbuild/internal/logger"
|
|
)
|
|
|
|
func AssertEqual(t *testing.T, a interface{}, b interface{}) {
|
|
t.Helper()
|
|
if a != b {
|
|
t.Fatalf("%s != %s", a, b)
|
|
}
|
|
}
|
|
|
|
func SourceForTest(contents string) logger.Source {
|
|
return logger.Source{
|
|
Index: 0,
|
|
KeyPath: logger.Path{Text: "<stdin>"},
|
|
PrettyPath: "<stdin>",
|
|
Contents: contents,
|
|
IdentifierName: "stdin",
|
|
}
|
|
}
|