1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: unify const names to snake_case

This commit is contained in:
yuyi
2020-05-22 23:36:09 +08:00
committed by GitHub
parent aef751861d
commit dda875a9c8
58 changed files with 543 additions and 540 deletions

View File

@ -10,7 +10,7 @@ import os
import benchmark
const (
INNER_INDENT = ' '
inner_indent = ' '
)
struct BenchedTests {
@ -21,7 +21,7 @@ mut:
test_suit_file string
step_func_name string
}
// ///////////////////////////////////////////////////////////////////
// Called at the start of the test program produced by `v -stats file_test.v`
fn start_testing(total_number_of_tests int, vfilename string) BenchedTests {
@ -49,7 +49,7 @@ fn (mut b BenchedTests) testing_step_end() {
// ////////////////////////////////////////////////////////////////
if ok_diff == 0 && fail_diff == 0 {
b.bench.neither_fail_nor_ok()
println(INNER_INDENT + b.bench.step_message_ok(' NO asserts | ') + b.fn_name())
println(inner_indent + b.bench.step_message_ok(' NO asserts | ') + b.fn_name())
return
}
// ////////////////////////////////////////////////////////////////
@ -61,11 +61,11 @@ fn (mut b BenchedTests) testing_step_end() {
}
// ////////////////////////////////////////////////////////////////
if ok_diff > 0 && fail_diff == 0 {
println(INNER_INDENT + b.bench.step_message_ok(nasserts(ok_diff)) + b.fn_name())
println(inner_indent + b.bench.step_message_ok(nasserts(ok_diff)) + b.fn_name())
return
}
if fail_diff > 0 {
println(INNER_INDENT + b.bench.step_message_fail(nasserts(fail_diff)) + b.fn_name())
println(inner_indent + b.bench.step_message_fail(nasserts(fail_diff)) + b.fn_name())
return
}
}
@ -77,7 +77,7 @@ fn (b &BenchedTests) fn_name() string {
// Called at the end of the test program produced by `v -stats file_test.v`
fn (mut b BenchedTests) end_testing() {
b.bench.stop()
println(INNER_INDENT + b.bench.total_message('running V tests in "' + os.file_name(b.test_suit_file) + '"'))
println(inner_indent + b.bench.total_message('running V tests in "' + os.file_name(b.test_suit_file) + '"'))
}
// ///////////////////////////////////////////////////////////////////

View File

@ -30,7 +30,7 @@ const (
'_linux.v', '_nix.v'], ['macos', '_mac.v', '_darwin.v'], ['freebsd', '_bsd.v', '_freebsd.v'],
['netbsd', '_bsd.v', '_netbsd.v'], ['openbsd', '_bsd.v', '_openbsd.v'], ['solaris', '_solaris.v'],
['haiku', '_haiku.v'], ['qnx', '_qnx.v']]
FORMATTED_FILE_TOKEN = '\@\@\@' + 'FORMATTED_FILE: '
formatted_file_token = '\@\@\@' + 'FORMATTED_FILE: '
)
fn main() {
@ -116,8 +116,8 @@ fn main() {
continue
}
if worker_result.output.len > 0 {
if worker_result.output.contains(FORMATTED_FILE_TOKEN) {
wresult := worker_result.output.split(FORMATTED_FILE_TOKEN)
if worker_result.output.contains(formatted_file_token) {
wresult := worker_result.output.split(formatted_file_token)
formatted_warn_errs := wresult[0]
formatted_file_path := wresult[1]
foptions.post_process_file(fpath, formatted_file_path)
@ -157,7 +157,7 @@ fn (foptions &FormatOptions) format_file(file string) {
if foptions.is_verbose {
eprintln('fmt.fmt worked and ${formatted_content.len} bytes were written to ${vfmt_output_path} .')
}
eprintln('${FORMATTED_FILE_TOKEN}${vfmt_output_path}')
eprintln('${formatted_file_token}${vfmt_output_path}')
}
fn print_compiler_options(compiler_params &pref.Preferences) {