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

ADDING MORE TEST FOR std::string ON ALL PLATFORMS #15

Merged
merged 1 commit into from
Feb 11, 2024

Conversation

Emmankoko
Copy link
Collaborator

No description provided.

Comment on lines 31 to 34
auto b = std_string("Hi, this is a test for string capacity growth for a length more than the base SSO");
assert(b.capacity == stringCapacity("Hi, this is a test for string capacity growth for a length more than the base SSO"));
a.swap(b); // a and b swaps
assert(a.capacity == stringCapacity("Hi, this is a test for string capacity growth for a length more than the base SSO"));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
auto b = std_string("Hi, this is a test for string capacity growth for a length more than the base SSO");
assert(b.capacity == stringCapacity("Hi, this is a test for string capacity growth for a length more than the base SSO"));
a.swap(b); // a and b swaps
assert(a.capacity == stringCapacity("Hi, this is a test for string capacity growth for a length more than the base SSO"));
immutable LongStr = "Hi, this is a test for string capacity growth for a length more than the base SSO";
auto b = std_string(LongStr);
assert(b.capacity == stringCapacity(LongStr.ptr));
a.swap(b); // a and b swaps
assert(a.capacity == stringCapacity(LongStr.ptr));

assert(a.empty == 0);
a.clear();
assert(a.empty == 1);

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why? Unecessary?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, why would you have trailing whitespace ?

@Geod24 Geod24 merged commit 0f6f44e into dlang:v1.x.x Feb 11, 2024
4 checks passed
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