Skip to content

Commit

Permalink
Merge pull request #1330 from Barsik-sus/wca_list_value_display_issue
Browse files Browse the repository at this point in the history
 READY: (wca): Wrote a test that shows an issue related to value displaying
  • Loading branch information
Wandalen authored Jun 1, 2024
2 parents e93f2f7 + faa9a80 commit 0e65d3d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions module/move/wca/tests/inc/grammar/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ tests_impls!
let inner_numbers : Vec< f64 > = numbers.into();
a_id!( vec![ 100.0, 3.14 ], inner_numbers );
}

// xxx : The try_cast method on value is designed to convert user input strings into parsed values, such as lists of strings or numbers. However, when converting these parsed values back into their original string representations using the display method, the resulting string may not match the original user input.
fn values_list_display()
{
let origin_string = "some,string";
let string = Type::List( Type::String.into(), ',' ).try_cast( origin_string.into() ).unwrap();
a_id!( origin_string, string.to_string() );

let origin_string = "100;3.14";
let string = Type::List( Type::Number.into(), ';' ).try_cast( origin_string.into() ).unwrap();
a_id!( origin_string, string.to_string() );
}
}

//
Expand All @@ -137,4 +149,5 @@ tests_index!
path,
boolean,
values_list,
values_list_display,
}

0 comments on commit 0e65d3d

Please sign in to comment.