Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

String methods #270

Open
wants to merge 12 commits into
base: q2
Choose a base branch
from
Open

String methods #270

wants to merge 12 commits into from

Conversation

itamarst
Copy link
Contributor

@itamarst itamarst commented Dec 7, 2016

The most worrisome change here is changing the way assertEqual works on Javascript and Go. If there are places where asserting identity matters then we should add assertIdentical and use it where appropriate.

@itamarst itamarst changed the base branch from master to q2 December 7, 2016 15:46
@rhs
Copy link
Contributor

rhs commented Dec 7, 2016

Are you saying now that "objects", i.e. implementations of interfaces are now also compared by-value by assertEqual, e.g. if I do class Foo() {}, what does assertNotEqual(new Foo(), new Foo()) do?

I am going to try this now just for giggles. ;-)

@rhs
Copy link
Contributor

rhs commented Dec 7, 2016

Ok, this fails on Go and Javascript (and passes everywhere else):

class Foo {}

void test_identity() {
    assertNotEqual(new Foo(), new Foo());
}

@@ -304,6 +304,87 @@ class StringTest {
assertEqual(false, "abc" == "def");
}

void upper_lower() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than growing primitives.q even more, can we put these type-specific tests into separate quark files? Maybe something like bi_string.q (for built-in) or lib_list.q or whatever? Something consistent would be great.

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

Successfully merging this pull request may close these issues.

3 participants