mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby: better assertions
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
287d2adab0
commit
3ac0ec4ecd
45 changed files with 532 additions and 510 deletions
|
@ -4,14 +4,14 @@ class TestStringchar < Test::Unit::TestCase
|
|||
def test_string
|
||||
assert_equal("abcd", "abcd")
|
||||
assert_match(/abcd/, "abcd")
|
||||
assert("abcd" === "abcd")
|
||||
assert_operator("abcd", :===, "abcd")
|
||||
# compile time string concatenation
|
||||
assert_equal("abcd", "ab" "cd")
|
||||
assert_equal("22aacd44", "#{22}aa" "cd#{44}")
|
||||
assert_equal("22aacd445566", "#{22}aa" "cd#{44}" "55" "#{66}")
|
||||
assert("abc" !~ /^$/)
|
||||
assert("abc\n" !~ /^$/)
|
||||
assert("abc" !~ /^d*$/)
|
||||
assert_operator("abc", :!~, /^$/)
|
||||
assert_operator("abc\n", :!~, /^$/)
|
||||
assert_operator("abc", :!~, /^d*$/)
|
||||
assert_equal(3, ("abc" =~ /d*$/))
|
||||
assert("" =~ /^$/)
|
||||
assert("\n" =~ /^$/)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue