tests: fix option_print_errors_test.v (#9616)

pull/9642/head weekly.2021.14
Ali Chraghi 2021-04-08 10:16:08 +04:30 committed by GitHub
parent 690c0309ad
commit 9881ff8448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -209,7 +209,6 @@ fn main() {
mut tsession := testing.new_test_session(cmd_prefix)
tsession.files << all_test_files
tsession.skip_files << skip_test_files
tsession.skip_files << 'vlib/v/tests/option_print_errors_test.v'
mut werror := false
mut sanitize_memory := false
mut sanitize_address := false

View File

@ -1,10 +1,10 @@
fn test_error_can_be_converted_to_string() {
assert 'Option{ error: "an error" }' == error('an error').str()
assert 'an error' == error('an error').str()
}
fn test_error_can_be_assigned_to_a_variable() {
f := error('an error')
assert 'Option{ error: "an error" }' == f.str()
assert 'an error' == f.msg
}
fn test_error_can_be_printed() {
@ -16,5 +16,5 @@ fn test_error_can_be_printed() {
fn test_error_can_be_interpolated_in_a_string() {
f := error('an error')
s := 'hi $f'
assert s == 'hi Option{ error: "an error" }'
assert s == 'hi an error'
}