Commit 8d0ea0e
authored
[no important files changed] Make sure the tests displays unicode characters properly [no important files changed] (#164)
* Make sure the tests displays unicode characters properly
The generic 'expect_slices_match()' routine use the '%v' format,
when applied to string with unicode, this displays the code
points rather than the unicode characters.
For example, the test 'test_handles_case_of_greek_letters'
display the expected result as
'["\u0392\u0393\u0391", "\u03b3\u03b2\u03b1"].
I modified the 'expect_slices_match()' procedure to use
strings and '%s' instead and now the expected result looks like
'[ΒΓΑ, γβα]'.
* Incorporate comments from the Peer Review
I modified the description in the When Writing Tests How to
Compare Resylt and Expected for Slice FAQ and created
the expect_helpers.odin template to provide an official
version of the comparison function for string slices and
general slices.1 parent fe1ca06 commit 8d0ea0e
File tree
3 files changed
+44
-19
lines changed- dev
- docs/faqs
- templates
- exercises/practice/anagram
3 files changed
+44
-19
lines changedLines changed: 9 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 10 | + | |
| 11 | + | |
23 | 12 | | |
24 | 13 | | |
25 | 14 | | |
26 | 15 | | |
27 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
28 | 19 | | |
29 | 20 | | |
30 | 21 | | |
| |||
36 | 27 | | |
37 | 28 | | |
38 | 29 | | |
39 | | - | |
| 30 | + | |
40 | 31 | | |
41 | 32 | | |
42 | 33 | | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments