Sha256: 176e7e3cb0aee2396a6f2eb3b63e7f59728887239ffcb39d4968129f3a025ff6
Contents?: true
Size: 820 Bytes
Versions: 6
Compression:
Stored size: 820 Bytes
Contents
# backtick_javascript: true require 'test/unit' require 'nodejs' class TestString < Test::Unit::TestCase def test_should_get_bytes assert_equal('foo'.bytesize, 3) assert_equal('foo'.each_byte.to_a, [102, 111, 111]) assert_equal('foo'.bytes, [102, 111, 111]) assert_equal('foo'.bytes, [102, 111, 111]) end def test_frozen # Commented out examples somehow work in the strict mode, # but otherwise they don't. I have unfortunately no idea # on where it's mangled, but then I don't see it really # as a really harmful thing. #assert_equal((-'x').frozen?, true) assert_equal((+'x').frozen?, false) #assert_equal((-+-'x').frozen?, true) assert_equal((+-+'x').frozen?, false) #assert_equal((`'x'`).frozen?, true) assert_equal((+`'x'`).frozen?, false) end end
Version data entries
6 entries across 6 versions & 1 rubygems