mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix tests
This commit is contained in:
parent
e457bedaa7
commit
b2f05e56b8
@ -19,7 +19,7 @@ pub fn parse(s string) ?Time {
|
|||||||
minute := hms[1]
|
minute := hms[1]
|
||||||
second := hms[2]
|
second := hms[2]
|
||||||
|
|
||||||
return new_time(Time{
|
res := new_time(Time{
|
||||||
year: ymd[0].int()
|
year: ymd[0].int()
|
||||||
month: ymd[1].int()
|
month: ymd[1].int()
|
||||||
day: ymd[2].int()
|
day: ymd[2].int()
|
||||||
@ -27,6 +27,7 @@ pub fn parse(s string) ?Time {
|
|||||||
minute: minute.int()
|
minute: minute.int()
|
||||||
second: second.int()
|
second: second.int()
|
||||||
})
|
})
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse_rfc2822 returns time from a date string in RFC 2822 datetime format.
|
// parse_rfc2822 returns time from a date string in RFC 2822 datetime format.
|
||||||
|
@ -102,7 +102,7 @@ i < 10; i++) {
|
|||||||
bool b2 = (*(bool*)array_get(bools, 0)) || true;
|
bool b2 = (*(bool*)array_get(bools, 0)) || true;
|
||||||
bool b3 = get_bool() || true;
|
bool b3 = get_bool() || true;
|
||||||
int f = array_first(nums);
|
int f = array_first(nums);
|
||||||
array_int c = array_clone(nums);
|
array_int c = array_clone(&nums);
|
||||||
string d = tos3("d");
|
string d = tos3("d");
|
||||||
println(string_add(s, d));
|
println(string_add(s, d));
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,17 @@ fn get_opt() ?int {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
fn new_user() User {
|
||||||
|
return User{}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_user_opt() ?User {
|
||||||
|
return new_user()
|
||||||
|
//return User{age:20, name:'Peter'}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
fn (u &User) foo() {
|
fn (u &User) foo() {
|
||||||
age := u.age
|
age := u.age
|
||||||
zzz := [''].repeat(u.age)
|
zzz := [''].repeat(u.age)
|
||||||
|
Loading…
Reference in New Issue
Block a user