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

Anagram Issue with tests #22

Closed
ghost opened this issue Oct 2, 2014 · 13 comments
Closed

Anagram Issue with tests #22

ghost opened this issue Oct 2, 2014 · 13 comments
Assignees

Comments

@ghost
Copy link

ghost commented Oct 2, 2014

When I try to compile my program (which has no other errors in it) I get the error
anagram_test.cpp:9:45: error: cannot call constructor 'anagram::anagram' directly [-fpermissive]

I think you could just say
auto subject = anagram("diaper");
for the offending line, and all others like it.

@LegalizeAdulthood
Copy link
Contributor

Thanks for the info! This is one of those things where different compilers have different idiosyncracies. We have a namespace anagram which holds a class anagram. I think the best way to resolve this is to make them have different names.

@LegalizeAdulthood LegalizeAdulthood self-assigned this Oct 2, 2014
@ghost
Copy link
Author

ghost commented Oct 5, 2014

Soo can you fix this or what? It would literally take 1 minute.

@kytrinyx
Copy link
Member

kytrinyx commented Oct 5, 2014

Hi @lennthevator - for small fixes we always leave the option open to the poster to fix it first, once we've determined that the fix is welcome.

If you don't want to submit a patch, that's totally cool, we can do it. ❤️

@ghost
Copy link
Author

ghost commented Oct 5, 2014

I don't know how to submit a patch.

@kytrinyx
Copy link
Member

kytrinyx commented Oct 5, 2014

Ok, no problem.

@ghost
Copy link
Author

ghost commented Oct 6, 2014

Well I tried to submit a patch, but Travis says that ana is not a member of anagram. However, the header file where anagram is defined is not even in your repository. What gives?

@LegalizeAdulthood
Copy link
Contributor

Sample implementations are in example.h and example.cpp in the folder for the problem. You will need to change the tests and the implementation. However, ana is not a good name, IMO. Namespace anagram and function/class name matcher reveal more intention than the cryptic ana, i.e.

BOOST_AUTO_TEST_CASE(no_matches)
{
    auto subject = anagram::matcher("diaper");
    auto matches = subject.matches({"hello", "world", "zombies", "pants"});
    vector<string> expected;

    BOOST_REQUIRE_EQUAL_COLLECTIONS(expected.begin(), expected.end(), matches.begin(), matches.end());
}

@ghost
Copy link
Author

ghost commented Oct 6, 2014

Alright, so you can change that to matcher. I'm not going to submit any more pull requests, because you said not to.

@LegalizeAdulthood
Copy link
Contributor

I suspect you aren't using gcc 4.8, as the travis build was compiling these just fine with gcc 4.8.

@kytrinyx
Copy link
Member

kytrinyx commented Oct 6, 2014

I'm not going to submit any more pull requests, because you said not to.

Please do update pull request #26 which you've already opened, though. Thanks!

@ghost
Copy link
Author

ghost commented Oct 6, 2014

So are you saying I should change ana to matcher? Should I also update example.h? I suspect the problem is with my compiler though, as I am using gcc 4.7.3. I will try to update my compiler, and if that works, I'll close the pull request. If not, I'll do what you say to do.

@ghost
Copy link
Author

ghost commented Oct 6, 2014

Can someone take a look at my new pull #27 ? I don't know what's happening. I closed #26 by the way.

@ghost
Copy link
Author

ghost commented Oct 6, 2014

I figured it out. I wasn't using namspaces at all.

@ghost ghost closed this as completed Oct 6, 2014
This issue was closed.
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

No branches or pull requests

2 participants