Skip to content

Commit 8fabbcf

Browse files
committed
about_strings finish
1 parent 405d3d8 commit 8fabbcf

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

python2/koans/about_strings.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_raw_strings_are_also_strings(self):
2828

2929
def test_use_single_quotes_to_create_string_with_double_quotes(self):
3030
string = 'He said, "Go Away."'
31-
self.assertEqual("He said, 'Go Away.", string)
31+
self.assertEqual('He said, "Go Away."', string)
3232

3333
def test_use_double_quotes_to_create_strings_with_single_quotes(self):
3434
string = "Don't"
@@ -37,59 +37,59 @@ def test_use_double_quotes_to_create_strings_with_single_quotes(self):
3737
def test_use_backslash_for_escaping_quotes_in_strings(self):
3838
a = "He said, \"Don't\""
3939
b = 'He said, "Don\'t"'
40-
self.assertEqual(__, (a == b))
40+
self.assertEqual(True, (a == b))
4141

4242
def test_use_backslash_at_the_end_of_a_line_to_continue_onto_the_next_line(self):
4343
string = "It was the best of times,\n\
4444
It was the worst of times."
45-
self.assertEqual(__, len(string))
45+
self.assertEqual(52, len(string))
4646

4747
def test_triple_quoted_strings_can_span_lines(self):
4848
string = """
4949
Howdy,
5050
world!
5151
"""
52-
self.assertEqual(__, len(string))
52+
self.assertEqual(15, len(string))
5353

5454
def test_triple_quoted_strings_need_less_escaping(self):
5555
a = "Hello \"world\"."
5656
b = """Hello "world"."""
57-
self.assertEqual(__, (a == b))
57+
self.assertEqual(True, (a == b))
5858

5959
def test_escaping_quotes_at_the_end_of_triple_quoted_string(self):
6060
string = """Hello "world\""""
61-
self.assertEqual(__, string)
61+
self.assertEqual('Hello "world"', string)
6262

6363
def test_plus_concatenates_strings(self):
6464
string = "Hello, " + "world"
65-
self.assertEqual(__, string)
65+
self.assertEqual("Hello, world", string)
6666

6767
def test_adjacent_strings_are_concatenated_automatically(self):
6868
string = "Hello" ", " "world"
69-
self.assertEqual(__, string)
69+
self.assertEqual("Hello, world", string)
7070

7171
def test_plus_will_not_modify_original_strings(self):
7272
hi = "Hello, "
7373
there = "world"
7474
string = hi + there
75-
self.assertEqual(__, hi)
76-
self.assertEqual(__, there)
75+
self.assertEqual("Hello, ", hi)
76+
self.assertEqual("world", there)
7777

7878
def test_plus_equals_will_append_to_end_of_string(self):
7979
hi = "Hello, "
8080
there = "world"
8181
hi += there
82-
self.assertEqual(__, hi)
82+
self.assertEqual("Hello, world", hi)
8383

8484
def test_plus_equals_also_leaves_original_string_unmodified(self):
8585
original = "Hello, "
8686
hi = original
8787
there = "world"
8888
hi += there
89-
self.assertEqual(__, original)
89+
self.assertEqual("Hello, ", original)
9090

9191
def test_most_strings_interpret_escape_characters(self):
9292
string = "\n"
9393
self.assertEqual('\n', string)
9494
self.assertEqual("""\n""", string)
95-
self.assertEqual(__, len(string))
95+
self.assertEqual(1, len(string))

0 commit comments

Comments
 (0)