From 21d98ff90428f9c1639e3722ce9c38ed0966d62c Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:47:49 +0200 Subject: [PATCH] comment why values are changed in decoding method --- vlib/toml/tests/encode_and_decode_test.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/toml/tests/encode_and_decode_test.v b/vlib/toml/tests/encode_and_decode_test.v index 39fcca3365..554b668738 100644 --- a/vlib/toml/tests/encode_and_decode_test.v +++ b/vlib/toml/tests/encode_and_decode_test.v @@ -77,8 +77,9 @@ pub fn (mut e Employee) from_toml(any toml.Any) { mp := any.as_map() e.name = mp['name'] or { toml.Any('') }.string() e.age = mp['age'] or { toml.Any(0) }.int() - e.salary = mp['salary'] or { toml.Any(0) }.f32() - 15000.0 e.is_human = mp['is_human'] or { toml.Any(false) }.bool() + // Change some values to assert that the structs method is used instead of generic decoding. + e.salary = mp['salary'] or { toml.Any(0) }.f32() - 15000.0 e.title = unsafe { JobTitle(mp['title'] or { toml.Any(0) }.int() - 2) } }