Exemplo n.º 1
0
    def test_SubstrWWithZeroLength(self):
        subString = substr("abcdef", 3, 0)

        self.assertFalse(subString)
Exemplo n.º 2
0
    def test_SubstrWithNegativeLength(self):
        subString = substr("abcdef", 2, -1)

        self.assertEqual(subString, 'cde')
Exemplo n.º 3
0
    def test_SubstrWithANumberTooNegative(self):
        subString = substr("abcdef", 4, -4)

        self.assertFalse(subString)
Exemplo n.º 4
0
    def test_SubstrWithNULLInput(self):
        subString = substr(None, -1)

        self.assertFalse(subString)
Exemplo n.º 5
0
    def test_SubstrWithPositiveLength(self):
        subString = substr("abcdef", 3, 1)

        self.assertEqual(subString, 'd')
Exemplo n.º 6
0
    def test_SubstrWithNegativeStartIndex(self):
        subString = substr("hello", -1)

        self.assertEqual(subString, "o")
Exemplo n.º 7
0
    def test_SubstrLenthLessThanNegativeStartIndex(self):
        subString = substr("one", -4)

        self.assertFalse(subString)
Exemplo n.º 8
0
	def test_SubstrWWithZeroLength(self):
		subString = substr("abcdef", 3, 0)

		self.assertFalse(subString)
Exemplo n.º 9
0
    def test_SubstrWithPositiveStartIndex(self):
        subString = substr("hello", 2)

        self.assertEqual(subString, "llo")
Exemplo n.º 10
0
	def test_SubstrWithNegativeLength(self):
		subString = substr("abcdef", 2, -1)

		self.assertEqual(subString, 'cde')
Exemplo n.º 11
0
	def test_SubstrWithANumberTooNegative(self):
		subString = substr("abcdef", 4, -4)

		self.assertFalse(subString)
Exemplo n.º 12
0
	def test_SubstrWithPositiveLength(self):
		subString = substr("abcdef", 3, 1)

		self.assertEqual(subString, 'd')
Exemplo n.º 13
0
	def test_SubstrWithNULLInput(self):
		subString = substr(None, -1)

		self.assertFalse(subString)
Exemplo n.º 14
0
	def test_SubstrLenthLessThanNegativeStartIndex(self):
		subString = substr("one", -4)

		self.assertFalse(subString)
Exemplo n.º 15
0
	def test_SubstrWithNegativeStartIndex(self):
		subString = substr("hello", -1)

		self.assertEqual(subString, "o")
Exemplo n.º 16
0
	def test_SubstrWithPositiveStartIndex(self):
		subString = substr("hello", 2)

		self.assertEqual(subString, "llo")