Skip to content

Release v0.6.13

Compare
Choose a tag to compare
@koodeex koodeex released this 26 Jul 12:05
· 183 commits to master since this release
1fbbf8d

Release v0.6.13

Features:

  • add JSONContains assert
    • JSONContains verifies if passed "actual" json contains passed "expected" json

Example:

         exp1 := `{"key1": 123, "key3": ["foo", "bar"]}`
         exp2 := `{"key1": 321, "key3": ["foobar", "bar"]}`
	 actual := `{"key1": 123, "key2": "foobar", "key3": ["foo", "bar"]}`

	JSONContains(mockT, expValid, actual) // passed cause "actual" contains exp1 json
	JSONContains(mockT, expNotValid, actual) // failed cause "actual" does not contain exp2 json
  • add Regexp assert
    • Regexp assert verifies if passed string is valid for passed regexp

Example:

	rx := `^start`
	str1 := "start of the line"
        str2 := "of the line"

	Regexp(mockT, rx, str1) // passed cause str1 matches regexp (rx)
	Regexp(mockT, rx, str2) // failed cause str2 does not match regexp (rx)

NOTE: new asserts available from require/assert packages and from t.Require()/t.Assert() methods