Skip to content

Instantly share code, notes, and snippets.

@mhberger
Last active April 2, 2019 09:58
Show Gist options
  • Save mhberger/d226c618962003d347c9 to your computer and use it in GitHub Desktop.
Save mhberger/d226c618962003d347c9 to your computer and use it in GitHub Desktop.
Groovy Truth
// based on http://groovy.329449.n5.nabble.com/String-isEmpty-tp346469p346472.html
assert !(0 as char)
assert (1 as char)
assert !0
assert 1
assert !0.0
assert !''
assert '1'
assert '0'
assert !""
assert "1"
assert "0"
assert !""""""
assert """1"""
assert """0"""
assert !null
assert new Object()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment