Skip to content

Commit

Permalink
Explain double quote backslash; closes #2597
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Jul 14, 2021
1 parent 07325bf commit 2a8defb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ch12-04-testing-the-librarys-functionality.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ yet.
function we wish we had</span>

This test searches for the string `"duct"`. The text we’re searching is three
lines, only one of which contains `"duct"`. We assert that the value returned
from the `search` function contains only the line we expect.
lines, only one of which contains `"duct"` (Note that the backslash after the
opening double quote tells Rust not to put a newline character at the beginning
of the contents of this string literal). We assert that the value returned from
the `search` function contains only the line we expect.

We aren’t able to run this test and watch it fail because the test doesn’t even
compile: the `search` function doesn’t exist yet! So now we’ll add just enough
Expand Down

0 comments on commit 2a8defb

Please sign in to comment.