vxx / vlib / v / tests / gg_import_check_test.v
21 lines · 17 sloc · 482 bytes · badd3466fd7ddc8a543badb4ecda4d999770ff91
Raw
1import os
2
3const issue_27584_vexe = os.quoted_path(@VEXE)
4
5fn test_importing_gg_checks_cleanly_on_linux() {
6 $if !linux {
7 return
8 }
9 source_path := os.join_path(os.vtmp_dir(), 'issue_27584_import_gg_${os.getpid()}.v')
10 defer {
11 os.rm(source_path) or {}
12 }
13 os.write_file(source_path, 'module main
14
15import gg as _
16
17fn main() {}
18') or { panic(err) }
19 res := os.execute('${issue_27584_vexe} -os linux -check ${os.quoted_path(source_path)}')
20 assert res.exit_code == 0, res.output
21}
22