MCPcopy Create free account
hub / github.com/buke/quickjs-go / TestRuntimeNewContextWithOptionsInitFailureHook

Function TestRuntimeNewContextWithOptionsInitFailureHook

runtime_test.go:1493–1506  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1491}
1492
1493func TestRuntimeNewContextWithOptionsInitFailureHook(t *testing.T) {
1494 restore := forceRuntimeInitFailureForTest(true)
1495 defer restore()
1496
1497 rt := NewRuntime()
1498 defer rt.Close()
1499
1500 ctx := rt.NewContextWithOptions(DefaultBootstrap())
1501 require.Nil(t, ctx)
1502
1503 ctx = rt.NewContextWithOptions(NoBootstrap())
1504 require.NotNil(t, ctx)
1505 ctx.Close()
1506}
1507
1508func TestForceRuntimeEvalFailureHookDisable(t *testing.T) {
1509 restore := forceRuntimeEvalFailureForTest(true)

Callers

nothing calls this directly

Calls 6

CloseMethod · 0.95
NewContextWithOptionsMethod · 0.95
NewRuntimeFunction · 0.85
DefaultBootstrapFunction · 0.85
NoBootstrapFunction · 0.85

Tested by

no test coverage detected