MCPcopy
hub / github.com/caddyserver/caddy / TestAcceptSiteImportWithBraces

Function TestAcceptSiteImportWithBraces

caddyconfig/caddyfile/parse_test.go:913–931  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

911}
912
913func TestAcceptSiteImportWithBraces(t *testing.T) {
914 p := testParser(`
915 (site) {
916 http://{args[0]} https://{args[0]} {
917 {block}
918 }
919 }
920
921 import site test.domain {
922 reverse_proxy http://192.168.1.1:8080 {
923 header_up Host {host}
924 }
925 }
926 `)
927 _, err := p.parseAll()
928 if err != nil {
929 t.Errorf("Expected error to be nil but got '%v'", err)
930 }
931}
932
933func TestGlobalOptionsAfterImportedSnippetsGivesHelpfulError(t *testing.T) {
934 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

testParserFunction · 0.85
parseAllMethod · 0.80

Tested by

no test coverage detected