-
Notifications
You must be signed in to change notification settings - Fork 1
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
(stdlib) Support ASCII-to-UTF8 string reassignment in compiled mode #466
Conversation
0dcea42
to
03531da
Compare
@@ -132,7 +132,7 @@ public void division_by_zero_throws_expected_runtime_error() | |||
[SkippableFact] | |||
public void division_by_zero_halts_execution() | |||
{ | |||
Skip.If(PerlangMode.ExperimentalCompilation, "Not supported in compiled mode"); | |||
Skip.If(PerlangMode.ExperimentalCompilation, "Division by zero has undefined behavior in compiled mode."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Just a drive-by-improvement to make the skip message a bit clearer. We should try to do similarly on all skipped tests, ideally (or better yet, fix them so they are no longer skipped))
// not be reassigned on the second line... because it is constant. We'll have to think through how to solve this | ||
// properly. | ||
Skip.If(PerlangMode.ExperimentalCompilation, "Not yet supported in compiled mode"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ This is the only test that didn't work in this test class. The other ones were just a matter of removing the skipping; they would already pass with our current code base.
03531da
to
1be792f
Compare
output.Should() | ||
.Be("this is a string"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for the sake of completeness. ASCIIString
was already doing the right thing, since its from_static_string()
was returned a std::shared_ptr<const ASCIIString>
return value.
|
||
#include "utf8_string.h" | ||
|
||
namespace perlang | ||
{ | ||
UTF8String UTF8String::from_static_string(const char* s) | ||
std::shared_ptr<const UTF8String> UTF8String::from_static_string(const char* s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ This is the fix that makes the test work.
No description provided.