Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
http: Remove redundant test file
Forgot to delete this when I moved its test into a different file
Matthew Holt committed
Feb 16, 2020 at 15:27 UTC
bf776e7de73205ff40caf7d95f05ddc4283116dd
1 file changed
-84
caddyconfig/httpcaddyfile/parser_test.go
deleted
-84
@@ -1,84 +0,0 @@
1
-// Copyright 2015 Matthew Holt and The Caddy Authors
2
-//
3
-// Licensed under the Apache License, Version 2.0 (the "License");
4
-// you may not use this file except in compliance with the License.
5
-// You may obtain a copy of the License at
6
-//
7
-// http://www.apache.org/licenses/LICENSE-2.0
8
-//
9
-// Unless required by applicable law or agreed to in writing, software
10
-// distributed under the License is distributed on an "AS IS" BASIS,
11
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
-// See the License for the specific language governing permissions and
13
-// limitations under the License.
14
-
15
-package httpcaddyfile
16
-
17
-import (
18
- "testing"
19
-
20
- caddyfile "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
21
-)
22
-
23
-func TestParse(t *testing.T) {
24
-
25
- for i, tc := range []struct {
26
- input string
27
- expectWarn bool
28
- expectError bool
29
- }{
30
- {
31
- input: `http://localhost
32
- @debug {
33
- query showdebug=1
34
- }
35
- `,
36
- expectWarn: false,
37
- expectError: false,
38
- },
39
- {
40
- input: `http://localhost
41
- @debug {
42
- query bad format
43
- }
44
- `,
45
- expectWarn: false,
46
- expectError: true,
47
- },
48
- {
49
- input: `
50
- {
51
- email test@anon.com
52
- acme_ca https://ca.custom
53
- acme_ca_root /root/certs/ca.crt
54
- }
55
-
56
- https://caddy {
57
- tls {
58
- ca https://ca.custom
59
- ca_root /root/certs/ca.crt
60
- }
61
- }
62
- `,
63
- expectWarn: false,
64
- expectError: false,
65
- },
66
- } {
67
-
68
- adapter := caddyfile.Adapter{
69
- ServerType: ServerType{},
70
- }
71
-
72
- _, warnings, err := adapter.Adapt([]byte(tc.input), nil)
73
-
74
- if len(warnings) > 0 != tc.expectWarn {
75
- t.Errorf("Test %d warning expectation failed Expected: %v, got %v", i, tc.expectWarn, warnings)
76
- continue
77
- }
78
-
79
- if err != nil != tc.expectError {
80
- t.Errorf("Test %d error expectation failed Expected: %v, got %s", i, tc.expectError, err)
81
- continue
82
- }
83
- }
84
-}