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

String methods#270

Open
itamarst wants to merge 12 commits intoq2from
itamarst/string-methods
Open

String methods#270
itamarst wants to merge 12 commits intoq2from
itamarst/string-methods

Conversation

@itamarst
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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());
}

Comment thread quarkc/test/e2e/primitives.q Outdated
assertEqual(false, "abc" == "def");
}

void upper_lower() {
Copy link
Copy Markdown
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