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

test: add tests for disallowing map/array get element/key address (#6568)

This commit is contained in:
Swastik Baranwal
2020-10-05 21:10:51 +05:30
committed by GitHub
parent 4b410534dd
commit d77669da80
8 changed files with 54 additions and 28 deletions

View File

@@ -182,17 +182,6 @@ fn test_delete() {
println('two' in m) // => true, on Linux and Windows <-- wrong !
}
/*
fn test_ref() {
m := { 'one': 1 }
// TODO "cannot take the address of m['one']"
mut one := &m['one']
one++
println(*one)
}
*/
fn test_delete_size() {
arr := ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
mut m := map[string]int