mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: fix option_print_errors_test.v (#9616)
This commit is contained in:
@@ -209,7 +209,6 @@ fn main() {
|
|||||||
mut tsession := testing.new_test_session(cmd_prefix)
|
mut tsession := testing.new_test_session(cmd_prefix)
|
||||||
tsession.files << all_test_files
|
tsession.files << all_test_files
|
||||||
tsession.skip_files << skip_test_files
|
tsession.skip_files << skip_test_files
|
||||||
tsession.skip_files << 'vlib/v/tests/option_print_errors_test.v'
|
|
||||||
mut werror := false
|
mut werror := false
|
||||||
mut sanitize_memory := false
|
mut sanitize_memory := false
|
||||||
mut sanitize_address := false
|
mut sanitize_address := false
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
fn test_error_can_be_converted_to_string() {
|
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() {
|
fn test_error_can_be_assigned_to_a_variable() {
|
||||||
f := error('an error')
|
f := error('an error')
|
||||||
assert 'Option{ error: "an error" }' == f.str()
|
assert 'an error' == f.msg
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_error_can_be_printed() {
|
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() {
|
fn test_error_can_be_interpolated_in_a_string() {
|
||||||
f := error('an error')
|
f := error('an error')
|
||||||
s := 'hi $f'
|
s := 'hi $f'
|
||||||
assert s == 'hi Option{ error: "an error" }'
|
assert s == 'hi an error'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user