We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97145ca commit c2e2aacCopy full SHA for c2e2aac
1 file changed
vlib/v/gen/c/testdata/autofree_toml.vv
@@ -2,14 +2,8 @@
2
import toml
3
import os
4
5
-fn main() {
6
- config_fname := 'config.toml'
7
- tab_title := 'test tab title'
8
- if !os.exists(config_fname) {
9
- mut f := os.create(config_fname) or { panic(err) }
10
- f.writeln('tab_title = "${tab_title}"') or { panic(err) }
11
- f.close()
12
- }
13
- doc := toml.parse_file(config_fname) or { panic(err) }
14
- assert doc.value('tab_title').string() == tab_title
15
-}
+config_fname := os.join_path(os.vtmp_dir(), 'config.toml')
+tab_title := 'test tab title'
+os.write_file(config_fname, 'tab_title = "${tab_title}"')!
+doc := toml.parse_file(config_fname)!
+assert doc.value('tab_title').string() == tab_title
0 commit comments