Skip to content

Commit

Permalink
Fix assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
rndstr committed Jun 6, 2017
1 parent bf91971 commit 2d994d6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions prog/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ func TestMakeContainerFiltersFromFlags(t *testing.T) {
containerLabelFlags.Set(`ti\:tle2:lab\:el=2`)
containerLabelFlags.Set(`ti tile3:label=3`)

err := containerLabelFlags.Set(`just a string`)
err := containerLabelFlags.Set("just a string")
assert.NotNil(t, err, "Invalid container label flag not detected")

apiTopologyOptions := containerLabelFlags.apiTopologyOptions
assert.Equal(t, 3, len(apiTopologyOptions))
assert.Equal(t, `title1`, apiTopologyOptions[0].Value)
assert.Equal(t, `label=1`, apiTopologyOptions[0].Label)
assert.Equal(t, `ti:tle2`, apiTopologyOptions[1].Value)
assert.Equal(t, `lab:el=2`, apiTopologyOptions[1].Label)
assert.Equal(t, `ti tle3`, apiTopologyOptions[2].Value)
assert.Equal(t, `label=3`, apiTopologyOptions[2].Label)
assert.Equal(t, "0", apiTopologyOptions[0].Value)
assert.Equal(t, "title1", apiTopologyOptions[0].Label)
assert.Equal(t, "1", apiTopologyOptions[1].Value)
assert.Equal(t, "ti:tle2", apiTopologyOptions[1].Label)
assert.Equal(t, "2", apiTopologyOptions[2].Value)
assert.Equal(t, "ti tile3", apiTopologyOptions[2].Label)
}

0 comments on commit 2d994d6

Please sign in to comment.