Sha256: a01ae39d29efcb9161a683aa66dc9854d9f98755beb60b0f8e498a04eefd1b27

Contents?: true

Size: 1.07 KB

Versions: 26

Compression:

Stored size: 1.07 KB

Contents

##
# Symbol(Ext) Test

assert('Symbol#to_proc') do
  assert_equal 5, :abs.to_proc[-5]
end

assert('Symbol.all_symbols') do
  foo = [:__symbol_test_1, :__symbol_test_2, :__symbol_test_3].sort
  symbols = Symbol.all_symbols.select{|sym|sym.to_s.include? '__symbol_test'}.sort
  assert_equal foo, symbols
end

assert("Symbol#length") do
  assert_equal 5, :hello.size
  assert_equal 5, :mruby.length
end

assert("Symbol#capitalize") do
  assert_equal :Hello, :hello.capitalize
  assert_equal :Hello, :HELLO.capitalize
  assert_equal :Hello, :Hello.capitalize
end

assert("Symbol#downcase") do
  assert_equal :hello, :hEllO.downcase
  assert_equal :hello, :hello.downcase
end

assert("Symbol#upcase") do
  assert_equal :HELLO, :hEllO.upcase
  assert_equal :HELLO, :HELLO.upcase
end

assert("Symbol#casecmp") do
  assert_equal 0, :HELLO.casecmp(:hEllO)
  assert_equal 1, :HELLO.casecmp(:hEllN)
  assert_equal(-1, :HELLO.casecmp(:hEllP))
  assert_nil :HELLO.casecmp("hEllO")
end

assert("Symbol#empty?") do
  assert_true :''.empty?
end

assert('Symbol#intern') do
  assert_equal :test, :test.intern
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
script_core-0.0.6 ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
script_core-0.0.5 ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.2.0 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.1.5 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.1.4 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.1.3 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.1.2 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.1.1 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.1.0 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.11 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.10 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.9 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.8 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.7 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.6 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.5 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.3 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.2 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
esruby-0.0.0 resources/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb
script_core-0.0.4 ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb