Skip to content

Commit

Permalink
test: add test for weak typing
Browse files Browse the repository at this point in the history
  • Loading branch information
justenwalker committed Apr 29, 2016
1 parent 232a03f commit 9776ebf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var testJSON = `{
"interfaces": "eth0",
"health": "/bin/to/healthcheck/for/service/A.sh",
"poll": 30,
"ttl": 19,
"ttl": "19",
"tags": ["tag1","tag2"]
},
{
Expand Down Expand Up @@ -80,6 +80,14 @@ func TestValidConfigParse(t *testing.T) {
t.Errorf("Expected no tags for serviceB, but got: %s", app.Services[1].Tags)
}

if app.Services[0].TTL != 19 {
t.Errorf("Expected ttl=19 for serviceA, but got: %d", app.Services[1].TTL)
}

if app.Services[1].TTL != 103 {
t.Errorf("Expected ttl=103 for serviceB, but got: %d", app.Services[1].TTL)
}

if app.Backends[0].Tag != "dev" {
t.Errorf("Expected tag %s for upstreamA, but got: %s", "dev", app.Backends[0].Tag)
}
Expand Down

0 comments on commit 9776ebf

Please sign in to comment.