MCPcopy Create free account
hub / github.com/CloudyKit/jet / TestTryCatch

Function TestTryCatch

eval_test.go:708–714  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

706}
707
708func TestTryCatch(t *testing.T) {
709 set := NewSet(NewOSFileSystemLoader("./testData/tryCatch"))
710 RunJetTestWithSet(t, set, nil, nil, "try", "before try without panic ...\n\nsome content\n\nfoo\n\nafter try without panic ...\nbefore panic ...\n\nafter panic ...")
711 RunJetTestWithSet(t, set, nil, nil, "try_catch", "before panic ...\n\nan error occured!\n\nafter panic ...")
712 RunJetTestWithSet(t, set, nil, nil, "try_catch_err", "before panic ...\n\nan error occured: Jet Runtime Error ("/try_catch_err.jet":3): identifier "undefined_identifier_that_causes_panic" not available in current (map[]) or parent scope, global, or default variables\n\nafter panic ...")
713 RunJetTestWithSet(t, set, nil, nil, "try_include", "before broken include ...\n\nafter broken include ...")
714}
715
716func TestBuiltinCollectionFuncs(t *testing.T) {
717 RunJetTest(t, nil, nil, "map_builtin", `{{ m := map( "foo", "bar", "asd", 123)}}{{m}}`, "map[asd:123 foo:bar]")

Callers

nothing calls this directly

Calls 3

NewSetFunction · 0.85
NewOSFileSystemLoaderFunction · 0.85
RunJetTestWithSetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…