MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / test_split_lines

Function test_split_lines

src/text_input.rs:3390–3405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3388
3389 #[test]
3390 fn test_split_lines() {
3391 let lines = split_lines("hello\nworld");
3392 assert_eq!(lines.len(), 2);
3393 assert_eq!(lines[0], (0, "hello"));
3394 assert_eq!(lines[1], (6, "world"));
3395
3396 let lines2 = split_lines("a\nb\nc");
3397 assert_eq!(lines2.len(), 3);
3398 assert_eq!(lines2[0], (0, "a"));
3399 assert_eq!(lines2[1], (2, "b"));
3400 assert_eq!(lines2[2], (4, "c"));
3401
3402 let lines3 = split_lines("no newlines");
3403 assert_eq!(lines3.len(), 1);
3404 assert_eq!(lines3[0], (0, "no newlines"));
3405 }
3406
3407 #[test]
3408 fn test_split_lines_trailing_newline() {

Callers

nothing calls this directly

Calls 1

split_linesFunction · 0.85

Tested by

no test coverage detected