added regexp for version returned

This commit is contained in:
Fabian Weber 2018-03-10 18:36:15 +01:00 committed by Ethan Buchman
parent 0121c98a1e
commit ef88f34d57
1 changed files with 4 additions and 6 deletions

View File

@ -118,12 +118,10 @@ func TestVersion(t *testing.T) {
res := request(t, r, "GET", "/version", nil)
require.Equal(t, http.StatusOK, res.Code, res.Body.String())
// TODO fix regexp
// reg, err := regexp.Compile(`v\d+\.\d+\.\d+(-dev)?`)
// require.Nil(t, err)
// match := reg.MatchString(res.Body.String())
// assert.True(t, match, res.Body.String())
assert.Equal(t, "0.11.1-dev", res.Body.String())
reg, err := regexp.Compile(`\d+\.\d+\.\d+(-dev)?`)
require.Nil(t, err)
match := reg.MatchString(res.Body.String())
assert.True(t, match, res.Body.String())
}
func TestNodeStatus(t *testing.T) {