projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.04k stars 95 forks source link

Resolve function instead in impl ResolveValue #262

Closed juliancoffee closed 1 year ago

juliancoffee commented 1 year ago

Before this change, we were using the version from WriteValue, which basically ignored the type of function and always converted it to string, which made NUMBER function useless when used on strings or even wrong when used on numbers. Fixes #261

juliancoffee commented 1 year ago

@zbraniecki do you want to review this? :eyes:

zbraniecki commented 1 year ago

Can you add a test please?

juliancoffee commented 1 year ago

@zbraniecki done. I basically copied my example as a test by replacing println! with assert_eq!. Let me know If I need to change something.