# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/nano/string/last.rb # # Extracted Fri Oct 28 14:20:18 EDT 2005 # Unit Tools Reap Test Extractor # require 'nano/string/last.rb' require 'test/unit' class TCString < Test::Unit::TestCase def test_last assert_equal( "z", "abcxyz".last ) assert_equal( "cz", "ax by cz".last(' ') ) assert_equal( "c", "a\nb\nc".last("\n") ) end def test_last_eq s = "abc" s.last = "123" assert_equal( "abc123", s ) s = "a\nbc" s.last = "123" assert_equal( "a\nbc123", s ) end def test_last! s = "abc" s.last! assert_equal( "ab", s ) s = "a b c" s.last!(' ') assert_equal( "a b", s ) end end