From ee4a179e71e2107c1694a6f7195fc56d060dd517 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 20 Jul 2022 11:29:01 +0300 Subject: [PATCH] tests: add a test for `Node{123, unsafe { nil }, unsafe { nil }}` --- vlib/v/tests/string_ref_struct_test.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/v/tests/string_ref_struct_test.v b/vlib/v/tests/string_ref_struct_test.v index e4eac1bb7a..e41277b4e2 100644 --- a/vlib/v/tests/string_ref_struct_test.v +++ b/vlib/v/tests/string_ref_struct_test.v @@ -9,3 +9,9 @@ fn test_string_ref_struct() { println(n.left) assert '$n.left' == '&nil' } + +fn test_string_ref_struct_with_nil_instead_of_0() { + n := Node{123, unsafe { nil }, unsafe { nil }} + println(n.left) + assert '$n.left' == '&nil' +}