all: change optional to result of io (#16075)

This commit is contained in:
yuyi 2022-10-16 14:28:57 +08:00 committed by GitHub
parent 6e46933c55
commit f6844e9766
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
187 changed files with 1885 additions and 1874 deletions

View file

@ -73,25 +73,25 @@ fn main() {
},
]
fn run_individual_test(case BumpTestCase) ? {
fn run_individual_test(case BumpTestCase) ! {
test_file := os.join_path_single(tfolder, case.file_name)
os.rm(test_file) or {}
os.write_file(test_file, case.contents)?
os.write_file(test_file, case.contents)!
//
os.execute_or_exit('${os.quoted_path(vexe)} bump --patch ${os.quoted_path(test_file)}')
patch_lines := os.read_lines(test_file)?
patch_lines := os.read_lines(test_file)!
assert patch_lines[case.line] == case.expected_patch
os.execute_or_exit('${os.quoted_path(vexe)} bump --minor ${os.quoted_path(test_file)}')
minor_lines := os.read_lines(test_file)?
minor_lines := os.read_lines(test_file)!
assert minor_lines[case.line] == case.expected_minor
os.execute_or_exit('${os.quoted_path(vexe)} bump --major ${os.quoted_path(test_file)}')
major_lines := os.read_lines(test_file)?
major_lines := os.read_lines(test_file)!
assert major_lines[case.line] == case.expected_major
//
os.rm(test_file)?
os.rm(test_file)!
}
fn test_all_bump_cases() {