File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 36
36
37
37
- name : Run BurntSushi TOML tests
38
38
run : ./v vlib/toml/tests/burntsushi.toml-test_test.v
39
+
40
+ - name : Get large_toml_file_test.toml
41
+ run : wget https://gist.githubusercontent.com/Larpon/89b0e3d94c6903851ff15559e5df7a05/raw/62a1f87a4e37bf157f2e0bfb32d85d840c98e422/large_toml_file_test.toml -O vlib/toml/tests/testdata/large_toml_file_test.toml
42
+
43
+ - name : Run large TOML file tests
44
+ run : ./v vlib/toml/tests/large_toml_file_test.v
Original file line number Diff line number Diff line change
1
+ import os
2
+ import toml
3
+
4
+ // Instructions for developers:
5
+ // The large (1MB) TOML file can be obtained by doing:
6
+ // `cd vlib/toml/tests/testdata`
7
+ // `wget https://gist.githubusercontent.com/Larpon/89b0e3d94c6903851ff15559e5df7a05/raw/62a1f87a4e37bf157f2e0bfb32d85d840c98e422/large_toml_file_test.toml`
8
+
9
+ // See also the CI toml tests
10
+
11
+ // test_large_file parser 'testdata/large_toml_file_test.toml' if found.
12
+ fn test_large_file () {
13
+ toml_file :=
14
+ os.real_path (os.join_path (os.dir (@FILE), 'testdata' , os.file_name (@FILE).all_before_last ('.' ))) +
15
+ '.toml'
16
+ if os.exists (toml_file) {
17
+ println ('Testing parsing of large (${os.file_size(toml_file)} bytes) "$toml_file "...' )
18
+ toml_doc := toml.parse (toml_file) or { panic (err) }
19
+ println ('OK [1/1] "$toml_file "...' ) // So it can be checked with `v -stats test ...`
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments