Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

READY: (wca): Wrote a test that shows an issue related to value displaying #1330

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 );
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add xxx

// 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,
}
Loading