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

Fix String Literals to Handle Newline. #54

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

DavidYeLuo
Copy link

Converts newline representation to its character form.

@dsLeks dsLeks requested review from PiJoules and dsLeks March 13, 2024 07:43
Copy link
Collaborator

@PiJoules PiJoules left a comment

Choose a reason for hiding this comment

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

Out of curiosity, were you able to test this locally? Just asking since I think building and running this test will also require linking against LLVM and I wanna make sure the instructions for getting LLVM are understandable.

test.cpp Outdated Show resolved Hide resolved
test.cpp Outdated Show resolved Hide resolved
test.cpp Show resolved Hide resolved
test.cpp Outdated
Comment on lines 46 to 47
std::string expectedStr = "Hello World";
expectedStr.insert(0, 1, '\n');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to above, this can be one single string with a newline at the start:

constexpr std::string_view kExpectedStr = "\nHello World";

test.cpp Outdated Show resolved Hide resolved
@DavidYeLuo
Copy link
Author

DavidYeLuo commented Mar 14, 2024

Out of curiosity, were you able to test this locally? Just asking since I think building and running this test will also require linking against LLVM and I wanna make sure the instructions for getting LLVM are understandable.

I was only using gtest last night. Before that, I installed gtest to fix compilation errors. My llvm which was version 14 seem to work fine last night.
It was able to reproduce the building + running section. Though, I tried to follow using the compiler but it wasn't producing the a.out file for some reason.
Currently, I'm installing llvm 16.04 to see if that fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants