mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-10-25 15:52:45 -04:00 
			
		
		
		
	Add TestNewDefault to config tests
Very simple test to make sure that NewDefault is populating the correct fields with the correct values.
This commit is contained in:
		
							parent
							
								
									159eb68a11
								
							
						
					
					
						commit
						7e41f6ed62
					
				| @ -8,6 +8,20 @@ import ( | ||||
| 	"github.com/mholt/caddy/server" | ||||
| ) | ||||
| 
 | ||||
| func TestNewDefault(t *testing.T) { | ||||
| 	config := NewDefault() | ||||
| 
 | ||||
| 	if actual, expected := config.Root, DefaultRoot; actual != expected { | ||||
| 		t.Errorf("Root was %s but expected %s", actual, expected) | ||||
| 	} | ||||
| 	if actual, expected := config.Host, DefaultHost; actual != expected { | ||||
| 		t.Errorf("Host was %s but expected %s", actual, expected) | ||||
| 	} | ||||
| 	if actual, expected := config.Port, DefaultPort; actual != expected { | ||||
| 		t.Errorf("Port was %d but expected %d", actual, expected) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| func TestResolveAddr(t *testing.T) { | ||||
| 	// NOTE: If tests fail due to comparing to string "127.0.0.1", | ||||
| 	// it's possible that system env resolves with IPv6, or ::1. | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user