(t *testing.T)
| 863 | } |
| 864 | |
| 865 | func TestRejectsGlobalMatcher(t *testing.T) { |
| 866 | p := testParser(` |
| 867 | @rejected path /foo |
| 868 | |
| 869 | (common) { |
| 870 | gzip foo |
| 871 | errors stderr |
| 872 | } |
| 873 | |
| 874 | http://example.com { |
| 875 | import common |
| 876 | } |
| 877 | `) |
| 878 | _, err := p.parseAll() |
| 879 | if err == nil { |
| 880 | t.Fatal("Expected an error, but got nil") |
| 881 | } |
| 882 | expected := "request matchers may not be defined globally, they must be in a site block; found @rejected, at Testfile:2" |
| 883 | if err.Error() != expected { |
| 884 | t.Errorf("Expected error to be '%s' but got '%v'", expected, err) |
| 885 | } |
| 886 | } |
| 887 | |
| 888 | func TestRejectAnonymousImportBlock(t *testing.T) { |
| 889 | p := testParser(` |
nothing calls this directly
no test coverage detected