diff options
| author | Inokentiy Babushkin <twk@twki.de> | 2017-06-11 16:45:51 +0200 |
|---|---|---|
| committer | Inokentiy Babushkin <twk@twki.de> | 2017-06-11 16:45:51 +0200 |
| commit | afe841587df0d20b344b576641d0a32d32b87f54 (patch) | |
| tree | db83f7678bcc6d614803197dbab1cd1bde11126e /src/libsyntax | |
| parent | 634cd2ce7398a82ee066e3111b9d20f837d39728 (diff) | |
| download | rust-afe841587df0d20b344b576641d0a32d32b87f54.tar.gz rust-afe841587df0d20b344b576641d0a32d32b87f54.zip | |
External spans: fixed unit tests and addressed review.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/codemap.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 8e04e47e25f..7267f510a49 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -618,6 +618,7 @@ impl FilePathMapping { #[cfg(test)] mod tests { use super::*; + use std::borrow::Cow; use std::rc::Rc; #[test] @@ -627,12 +628,12 @@ mod tests { "first line.\nsecond line".to_string()); fm.next_line(BytePos(0)); // Test we can get lines with partial line info. - assert_eq!(fm.get_line(0), Some("first line.")); + assert_eq!(fm.get_line(0), Some(Cow::from("first line."))); // TESTING BROKEN BEHAVIOR: line break declared before actual line break. fm.next_line(BytePos(10)); - assert_eq!(fm.get_line(1), Some(".")); + assert_eq!(fm.get_line(1), Some(Cow::from("."))); fm.next_line(BytePos(12)); - assert_eq!(fm.get_line(2), Some("second line")); + assert_eq!(fm.get_line(2), Some(Cow::from("second line"))); } #[test] |
