1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

raw strings with r'raw'

This commit is contained in:
Alexander Medvednikov
2019-10-06 03:56:08 +03:00
parent ebc50432c7
commit 6a0599b5f4
3 changed files with 28 additions and 13 deletions

View File

@@ -284,6 +284,6 @@ fn test_multi() {
assert a[0][2] == 3
assert a[1][2] == 6
// TODO
//b := [ [[1,2,3],[4,5,6]], [[1,2]] ]
//assert b[0][0][0] == 1
b := [ [[1,2,3],[4,5,6]], [[1,2]] ]
assert b[0][0][0] == 1
}

View File

@@ -464,3 +464,10 @@ fn test_repeat() {
s := 'V! '
assert s.repeat(5) == 'V! V! V! V! V! '
}
fn test_raw() {
raw := r'raw\nstring'
lines := raw.split('\n')
assert lines.len == 1
println('raw string: "$raw"')
}