Last active
June 20, 2019 00:46
-
-
Save bwangelme/8fc8dc5309c502a6c23b46c1ef24d39f to your computer and use it in GitHub Desktop.
extend assert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Int32LessEqual(t *testing.T, x, y int32, msgAndArgs ...interface{}) bool { | |
if x > y { | |
return assert.Fail(t, fmt.Sprintf("%d not less than %d", x, y), msgAndArgs) | |
} | |
return true | |
} | |
func TestMaxRune(t *testing.T) { | |
var maxRune int32 = 122 | |
for i := 'a'; i <= 'z'; i++ { | |
Int32LessEqual(t, i, maxRune) | |
} | |
for i := 'A'; i <= 'Z'; i++ { | |
Int32LessEqual(t, i, maxRune) | |
} | |
for i := '0'; i <= '9'; i++ { | |
Int32LessEqual(t, i, maxRune) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment