mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
map_test.v: format + ref test
This commit is contained in:
parent
af5b2e1b3c
commit
961e778ed1
@ -522,7 +522,7 @@ fn (p &Parser) find_type(name string) &Type {
|
|||||||
return typ
|
return typ
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (t &Table) find_type(name_ string) *Type {
|
fn (t &Table) find_type(name_ string) &Type {
|
||||||
mut name := name_
|
mut name := name_
|
||||||
if name.ends_with('*') && !name.contains(' ') {
|
if name.ends_with('*') && !name.contains(' ') {
|
||||||
name = name.left(name.len - 1)
|
name = name.left(name.len - 1)
|
||||||
|
@ -163,3 +163,14 @@ fn test_string_arr() {
|
|||||||
assert m['a'][0] == 'one'
|
assert m['a'][0] == 'one'
|
||||||
assert m['a'][1] == 'two'
|
assert m['a'][1] == 'two'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
fn test_ref() {
|
||||||
|
m := { 'one': 1 }
|
||||||
|
// TODO "cannot take the address of m['one']"
|
||||||
|
mut one := &m['one']
|
||||||
|
one++
|
||||||
|
println(*one)
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user