tests: fix quoted path bug in cmd/tools/vdoc/tests/vdoc_file_test.v, that effectively disabled most of the tests there

This commit is contained in:
Delyan Angelov 2023-11-28 14:38:21 +02:00
parent 50f3ac4968
commit 20c9ef21e5
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
6 changed files with 23 additions and 41 deletions

View file

@ -1,13 +1,9 @@
module main module main
const ( const source_root = 'temp' // some const
source_root = 'temp' // some const const another = int(5)
another = int(5) // const windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
)
const (
windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED //
)
Used to indicate that you don't care what the window position is. Used to indicate that you don't care what the window position is.
const windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED
fn funky() fn funky()
funky - comment for function below funky - comment for function below

View file

@ -1,11 +1,7 @@
module main module main
const ( const source_root = 'temp' // some const
source_root = 'temp' // some const const another = int(5)
another = int(5) // const windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
) const windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED
const (
windowpos_undefined_mask = C.SDL_WINDOWPOS_UNDEFINED_MASK // 0x1FFF0000u
windowpos_undefined = C.SDL_WINDOWPOS_UNDEFINED //
)
fn funky() fn funky()

View file

@ -1,13 +1,6 @@
The autogenerated documentation for builtin functions is lacking, so for these
functions, please refer to the
official V documentation.
Linebreaks are set deliberately to test handling of spaces in multi-line doc comments.
Related PR: https://github.com/vlang/v/pull/19938.
module main module main
The autogenerated documentation for `builtin` functions is lacking, so for these functions, please refer to the [official V documentation](https://github.com/vlang/v/blob/master/doc/docs.md).
Linebreaks are set deliberately to test handling of spaces in multi-line doc comments. Related PR: https://github.com/vlang/v/pull/19938.
const omega = 3 // should be first const omega = 3 // should be first
const alpha = 5 // should be in the middle const alpha = 5 // should be in the middle
const beta = 2 // should be at the end const beta = 2 // should be at the end

View file

@ -1,5 +1,5 @@
<section id="readme_main" class="doc-node"> <section id="readme_main" class="doc-node">
<div class="title"><h1> main <a href="#readme_main">#</a></h1></div><p>The autogenerated documentation for <code>builtin</code> functions is lacking, so for these functions, please refer to the <a href="https://github.com/vlang/v/blob/master/doc/docs.md">official V documentation</a>.</p><p>Linebreaks are set deliberately to test handling of spaces in multi-line doc comments. Related PR: <a href="https://github.com/vlang/v/pull/19938">https://github.com/vlang/v/pull/19938</a>.</p> <div class="title"><h1> main <a href="#readme_main">#</a></h1></div>
</section> </section>

View file

@ -1,8 +1,5 @@
module main module main
The autogenerated documentation for `builtin` functions is lacking, so for these functions, please refer to the [official V documentation](https://github.com/vlang/v/blob/master/doc/docs.md).
Linebreaks are set deliberately to test handling of spaces in multi-line doc comments. Related PR: https://github.com/vlang/v/pull/19938.
const omega = 3 // should be first const omega = 3 // should be first
const alpha = 5 // should be in the middle const alpha = 5 // should be in the middle
const beta = 2 // should be at the end const beta = 2 // should be at the end

View file

@ -61,43 +61,43 @@ fn check_path(dir string, tests []string) int {
paths := vtest.filter_vtest_only(tests, basepath: vroot) paths := vtest.filter_vtest_only(tests, basepath: vroot)
for path in paths { for path in paths {
mut fails := 0 mut fails := 0
program := os.quoted_path(path) qpath := os.quoted_path(path)
print(path + ' ') print(path + ' ')
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc ${program}' cmd: '${vexe} doc ${qpath}'
out_filename: 'main.out' out_filename: 'main.out'
) )
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc -comments ${program}' cmd: '${vexe} doc -comments ${qpath}'
out_filename: 'main.unsorted.out' out_filename: 'main.unsorted.out'
should_sort: false should_sort: false
) )
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc -comments ${program}' cmd: '${vexe} doc -comments ${qpath}'
out_filename: 'main.comments.out' out_filename: 'main.comments.out'
) )
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc -readme -comments ${program}' cmd: '${vexe} doc -readme -comments ${qpath}'
out_filename: 'main.readme.comments.out' out_filename: 'main.readme.comments.out'
) )
// test the main 3 different formats: // test the main 3 different formats:
program_dir := if os.is_file(path) { os.quoted_path(os.dir(path)) } else { program } program_dir := os.quoted_path(if os.is_file(path) { os.dir(path) } else { path })
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc -f html -o - -html-only-contents -readme -comments ${program_dir}' cmd: '${vexe} doc -f html -o - -html-only-contents -readme -comments ${program_dir}'
out_filename: 'main.html' out_filename: 'main.html'
) )
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc -f ansi -o - -html-only-contents -readme -comments ${program_dir}' cmd: '${vexe} doc -f ansi -o - -html-only-contents -readme -comments ${program_dir}'
out_filename: 'main.ansi' out_filename: 'main.ansi'
) )
fails += check_output( fails += check_output(
program: program program: path
cmd: '${vexe} doc -f text -o - -html-only-contents -readme -comments ${program_dir}' cmd: '${vexe} doc -f text -o - -html-only-contents -readme -comments ${program_dir}'
out_filename: 'main.text' out_filename: 'main.text'
) )