-
Notifications
You must be signed in to change notification settings - Fork 45
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
Bugfix: double map #4169
Bugfix: double map #4169
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
To repro, run: ``` cargo nextest run --test executor -E "test(no_visuals::double_map)" ``` The program emits this error: Syntax(KclErrorDetails { source_ranges: [SourceRange([31, 32])], message: "Invalid number: {\"type\":\"UserVal\",\"value\":1.0,\"__meta\":[{\"sourceRange\":[31,36]}]}" }) In other words, the second `map` statement is being passed an array of JSON STRINGS, not an array of numbers. The strings contain JSON stringified representations of user values which are numbers.
f7640e0
to
a9dc448
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4169 +/- ##
==========================================
- Coverage 86.22% 86.21% -0.01%
==========================================
Files 75 75
Lines 26689 26701 +12
==========================================
+ Hits 23013 23021 +8
- Misses 3676 3680 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Previously, map was wrapping KCL values in a JSON object unnecessarily. The new `double_map` test would emit this error: ``` Syntax(KclErrorDetails { source_ranges: [SourceRange([31, 32])], message: "Invalid number: {\"type\":\"UserVal\",\"value\":1.0,\"__meta\":[{\"sourceRange\":[31,36]}]}" }) ``` In other words, the second `map` statement is being passed an array of JSON STRINGS, not an array of numbers. The strings contain JSON stringified representations of user values which are numbers. Bug is now fixed.
Previously running
map
would change the output of the array, it would go from array of numbers to an array of objects that contain numbers. Fixed now.We should do #1130 to make this impossible in the future.