mirror of
https://github.com/komari-monitor/komari.git
synced 2026-11-24 17:10:54 +00:00
19 lines
354 B
Go
19 lines
354 B
Go
package native
|
|
|
|
import (
|
|
"errors"
|
|
moe "github.com/Calcium-Ion/moejs"
|
|
"testing"
|
|
)
|
|
|
|
func TestGoErrorNative(t *testing.T) {
|
|
rt := moe.NewRuntime(moe.Options{})
|
|
v := GoError(rt, errors.New("sentinel"))
|
|
if !v.IsObject() {
|
|
t.Fatalf("error value %v", v)
|
|
}
|
|
if String(rt, Get(rt, v.AsObject(), "message")) != "sentinel" {
|
|
t.Fatal("message lost")
|
|
}
|
|
}
|