def test_codePointCount(self): jstr = JString(u'0z?!あ表'); eq_(jstr.codePointCount(0, 0), 0) eq_(jstr.codePointCount(0, 1), 1) eq_(jstr.codePointCount(0, 2), 2) eq_(jstr.codePointCount(0, 3), 3) eq_(jstr.codePointCount(0, 4), 4) eq_(jstr.codePointCount(0, 5), 5)
def test_codePointAt(self): jstr = JString(u'0z?!あ表'); eq_(jstr.codePointAt(0), 48) eq_(jstr.codePointAt(1), 122) eq_(jstr.codePointAt(2), 63) eq_(jstr.codePointAt(3), 33) eq_(jstr.codePointAt(4), 12354) eq_(jstr.codePointAt(5), 34920)
def test_codePointBefore(self): jstr = JString(u'0z?!あ表'); eq_(jstr.codePointBefore(1), 48) eq_(jstr.codePointBefore(2), 122) eq_(jstr.codePointBefore(3), 63) eq_(jstr.codePointBefore(4), 33) eq_(jstr.codePointBefore(5), 12354) eq_(jstr.codePointBefore(6), 34920)
def test_compareTo(self): jstr = JString('abc') eq_(jstr.compareTo('abc'), 0) eq_(jstr.compareTo('aac'), 1) eq_(jstr.compareTo('acc'), -1) # 文字列の長さが異なるパターン eq_(jstr.compareTo('ab'), 1) eq_(jstr.compareTo('abcdef'), -3)
def test_charAt(self): jstr = JString('abc') eq_(jstr.charAt(0), 'a') eq_(jstr.charAt(1), 'b') eq_(jstr.charAt(2), 'c')