test high order function
parent
f51784ee01
commit
a594e009f2
|
@ -41,8 +41,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
brew services start postgresql
|
brew services start postgresql
|
||||||
sleep 3
|
sleep 3
|
||||||
psql -c -d postgres -c 'select rolname from pg_roles'
|
psql -d postgres -c 'select rolname from pg_roles'
|
||||||
psql -U postgres -d postgres -c 'create database customerdb;'
|
psql -d postgres -c 'create database customerdb;'
|
||||||
psql -d customerdb -f examples/database/pg/mydb.sql
|
psql -d customerdb -f examples/database/pg/mydb.sql
|
||||||
- name: Test v->c
|
- name: Test v->c
|
||||||
run: ./v test-compiler
|
run: ./v test-compiler
|
||||||
|
|
|
@ -115,6 +115,21 @@ fn high_fn_multi_return(a int, b fn (c []int, d []string) ([]int, []string)) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn sqr(x int) int {
|
||||||
|
return x * x
|
||||||
|
}
|
||||||
|
|
||||||
fn test_fns() {
|
fn test_fns() {
|
||||||
// no asserts for now, just test function declarations above
|
// no asserts for now, just test function declarations above
|
||||||
|
high_fn(sqr)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn test_anon_fn() {
|
||||||
|
/*
|
||||||
|
high_fn(fn (x int) int {
|
||||||
|
println('hello')
|
||||||
|
return x + 1
|
||||||
|
})
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue