Sha256: 69e73216917522d2d9bf99c5d8a60eddb05884b104cefaff23da60046ff0a46a
Contents?: true
Size: 968 Bytes
Versions: 8
Compression:
Stored size: 968 Bytes
Contents
require File.expand_path("../../helpers", __FILE__) class ScannerUnicodeBlocks < Test::Unit::TestCase tests = { 'InArabic' => :in_arabic, 'InCJK_Unified_Ideographs_Extension_A' => :in_cjk_unified_ideographs_extension_a, 'In Letterlike Symbols' => :in_letterlike_symbols, 'InMiscellaneous_Mathematical_Symbols-A' => :in_miscellaneous_mathematical_symbols_a, } tests.each_with_index do |(property, token), count| define_method "test_scanner_property_#{token}_#{count}" do tokens = RS.scan("a\\p{#{property}}c") result = tokens.at(1) assert_equal :property, result[0] assert_equal token, result[1] end define_method "test_scanner_nonproperty_#{token}_#{count}" do tokens = RS.scan("a\\P{#{property}}c") result = tokens.at(1) assert_equal :nonproperty, result[0] assert_equal token, result[1] end end end
Version data entries
8 entries across 8 versions & 2 rubygems