fix examples/v_script.vsh and add it to CI

pull/3006/head
Alexander Medvednikov 2019-12-07 18:27:09 +03:00
parent 63ec3c0486
commit 7d58dc2350
2 changed files with 41 additions and 39 deletions

View File

@ -52,6 +52,8 @@ jobs:
# run: ./v -o hi.js examples/hello_v_js.v && node hi.js # run: ./v -o hi.js examples/hello_v_js.v && node hi.js
- name: Test symlink - name: Test symlink
run: ./v symlink && v -o v2 v.v run: ./v symlink && v -o v2 v.v
- name: Test vsh
run: ./v examples/v_script.vsh
- name: Test vid - name: Test vid
run: | run: |
git clone --depth 1 https://github.com/vlang/vid.git git clone --depth 1 https://github.com/vlang/vid.git

View File

@ -1,39 +1,39 @@
fn main() { fn main() {
for _ in 0..5 { for _ in 0..5 {
println('V script') println('V script')
} }
println('deploying...') println('deploying...')
println('Files') println('Files')
foo := ls('.') or { panic(err) } foo := ls('.') or { panic(err) }
println(foo) println(foo)
println('') println('')
rm('a.out') rm('a.out')
println('Making dir name and creating foo.txt') println('Making dir name and creating foo.txt')
mkdir('name') os.mkdir('name')? // TODO mkdir()
create('foo.txt') create('foo.txt')?
foo_ls := ls('.') or { panic(err) } foo_ls := ls('.') or { panic(err) }
println(foo_ls) println(foo_ls)
println('') println('')
println('Entering into name') println('Entering into name')
chdir('name') chdir('name')
foo_ls2 := ls('.') or { panic(err) } foo_ls2 := ls('.') or { panic(err) }
println(foo_ls2) println(foo_ls2)
println('') println('')
println('Removing name and foo.txt') println('Removing name and foo.txt')
println('') println('')
chdir('../') chdir('../')
rmdir('name') rmdir('name')
rm('foo.txt') rm('foo.txt')
again := ls('.') or { panic(err) } again := ls('.') or { panic(err) }
println(again) println(again)
} }