MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_isdecimal

Method test_isdecimal

Lib/test/test_str.py:777–793  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

775 self.assertFalse("\U0010ffff".isascii())
776
777 def test_isdecimal(self):
778 self.checkequalnofix(False, '', 'isdecimal')
779 self.checkequalnofix(False, 'a', 'isdecimal')
780 self.checkequalnofix(True, '0', 'isdecimal')
781 self.checkequalnofix(False, '\u2460', 'isdecimal') # CIRCLED DIGIT ONE
782 self.checkequalnofix(False, '\xbc', 'isdecimal') # VULGAR FRACTION ONE QUARTER
783 self.checkequalnofix(True, '\u0660', 'isdecimal') # ARABIC-INDIC DIGIT ZERO
784 self.checkequalnofix(True, '0123456789', 'isdecimal')
785 self.checkequalnofix(False, '0123456789a', 'isdecimal')
786
787 self.checkraises(TypeError, 'abc', 'isdecimal', 42)
788
789 for ch in ['\U00010401', '\U00010427', '\U00010429', '\U0001044E',
790 '\U0001F40D', '\U0001F46F', '\U00011065', '\U0001F107']:
791 self.assertFalse(ch.isdecimal(), '{!a} is not decimal.'.format(ch))
792 for ch in ['\U0001D7F6', '\U00011066', '\U000104A0']:
793 self.assertTrue(ch.isdecimal(), '{!a} is decimal.'.format(ch))
794
795 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: False != True
796 def test_isdigit(self):

Callers

nothing calls this directly

Calls 6

checkequalnofixMethod · 0.95
assertFalseMethod · 0.80
assertTrueMethod · 0.80
checkraisesMethod · 0.45
isdecimalMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected