(t *testing.T)
| 673 | } |
| 674 | |
| 675 | func TestIncludeIfNotExists(t *testing.T) { |
| 676 | set := NewSet(NewOSFileSystemLoader("./testData/includeIfNotExists")) |
| 677 | RunJetTestWithSet(t, set, nil, nil, "existent", "Hi, i exist!!") |
| 678 | RunJetTestWithSet(t, set, nil, nil, "notExistent", "") |
| 679 | RunJetTestWithSet(t, set, nil, nil, "ifIncludeIfExits", "Hi, i exist!!\n Was included!!\n\n\n Was not included!!\n\n") |
| 680 | RunJetTestWithSet(t, set, nil, "World", "wcontext", "Hi, Buddy!\nHi, World!") |
| 681 | |
| 682 | // Check if includeIfExists helper bubbles up runtime errors of included templates |
| 683 | tt, err := set.GetTemplate("includeBroken") |
| 684 | if err != nil { |
| 685 | t.Error(err) |
| 686 | } |
| 687 | buff := bytes.NewBuffer(nil) |
| 688 | err = tt.Execute(buff, nil, nil) |
| 689 | if err == nil { |
| 690 | t.Error("expected includeIfExists helper to fail with a runtime error but got nil") |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | func TestExecReturn(t *testing.T) { |
| 695 | set := NewSet(NewOSFileSystemLoader("./testData/execReturn")) |
nothing calls this directly
no test coverage detected
searching dependent graphs…