| 1 | import os |
| 2 | |
| 3 | const sql_assert_temp_var_vexe = @VEXE |
| 4 | |
| 5 | const sql_assert_temp_var_vroot = os.real_path(@VMODROOT) |
| 6 | |
| 7 | const sql_assert_temp_var_testdata = os.join_path(sql_assert_temp_var_vroot, |
| 8 | 'vlib/v/gen/c/testdata/assert_sql_select_sub_array_field.vv') |
| 9 | |
| 10 | fn test_assert_with_inline_sql_select_compiles() { |
| 11 | os.chdir(sql_assert_temp_var_vroot) or {} |
| 12 | output_path := os.join_path(os.vtmp_dir(), 'assert_sql_select_sub_array_field.exe') |
| 13 | defer { |
| 14 | os.rm(output_path) or {} |
| 15 | } |
| 16 | cmd := '${os.quoted_path(sql_assert_temp_var_vexe)} -o ${os.quoted_path(output_path)} ${os.quoted_path(sql_assert_temp_var_testdata)}' |
| 17 | compilation := os.execute(cmd) |
| 18 | assert compilation.exit_code == 0, '${cmd}\n${compilation.output}' |
| 19 | } |
| 20 | |