From 9881ff84483a1f693083983c389960994d0691a7 Mon Sep 17 00:00:00 2001 From: Ali Chraghi <63465728+AliChraghi@users.noreply.github.com> Date: Thu, 8 Apr 2021 10:16:08 +0430 Subject: [PATCH] tests: fix option_print_errors_test.v (#9616) --- cmd/tools/vtest-self.v | 1 - vlib/v/tests/option_print_errors_test.v | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index 6a7634c05c..6ab37da62c 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -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 diff --git a/vlib/v/tests/option_print_errors_test.v b/vlib/v/tests/option_print_errors_test.v index b59d792aef..42fbfec1a1 100644 --- a/vlib/v/tests/option_print_errors_test.v +++ b/vlib/v/tests/option_print_errors_test.v @@ -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' }