• I am still confused, I would appreciate it, if someone could give me a helpful link

  • I've never seen this function call syntax before

  • I have solved the kata. There was no error :)

    Tip: check out test name

  • I meant the second case.

    Are you sure that there should be ; between add(1)(2) and a(3)? Not , ?


    auto a = add(1)(2);

    is the same as auto a = add(1)(2); a(3); in C++, isn't it?

  • Oh. I guess >I< am not reading. That assertion is wrong yes. But is there such an assertion somewhere? Where are you finding that?

    auto a = add(1)(2); // 3
    a(3); // should be 3 -- no it should be 6

    I see this in the test code. But that's not what you say, instead it is correctly saying 6

            std::cout << "auto a = add(1)(2); a(3) == 6\n";
            auto a = add(1)(2);
            Assert::That(a(3), Equals(6));

    There's also this case

    "auto a = add(1)(2); a(3); a == 3\n"

    which is again correct, and not what you say is an existing assertion

  • I think you're not reading the code and instead seeing what you expect?

  • Test assertion:

    auto a = add(1)(2); // 3
    a(3); // should be 3

    Kata's details:

    var AddTwo = add(2); // 2
    AddTwo(3); // should be 5 when a single call should return a passed value???

    Kata's example goes against her own rules, doesn't it?

  • You need to define operator << for your type. Otherwise, testing framework cannot stringify it to build an assertion message.

  • Xin-Shiyu, try to overload operator<<

  • The same problem. My solution works locally using Cygwin Clang 8.0.1 but raises a similar error here.

  • It's not telling you what it's doing which is unfair. It does this:

    a = add(1)(2)
    b = add(3)(4)
    test.assert_equals(add(1), 1, "A single call should return the number passed in")
    test.assert_equals(a(3), 6, "Must be able to store curried functions")
    test.expect(a == 3 and b == 7, "Must be able to store values")
  • I solved via classes in Python, all test passed but one. It says I have to store the values, while I stored in the class and still get this message. How or where should I store to not get this error message?

    Edit: I tried to return from function, but then it gives me another error that the next part of the 'chain' cant accept tuple as a valid input.

  • python 3.8 / new framework
    Current tests are just a couple fixed ones, I'm adding random tests and detailed error messages.
    Mild mad scientist warning. Feedback welcome.

  • This comment is hidden because it contains spoiler information about the solution

  • Good point. This method is new to me. Thanks for the explaination.

  • Loading more items...