Ad
  • Custom User Avatar

    You're misreading the two tests and assuming that they're the same but expecting two different results. They're not the same, hence the different expectations.

    If you don't yet see it, try replacing the call operators with add operators and add newlines after the semicolons - thus presenting it in a more familiar format and also forcing you to read it as part of editing it.

  • Custom User Avatar

    I don'tknow about C++ tests, but at least in javascript:

    it("Must be able to store values", () => {
    		const a = add(1)(2);
    		const b = add(3)(4);
    		equal(a, 3);
    		equal(b, 7);
    	});
    

    There is no a(3) call there.

  • Custom User Avatar

    Do these tests contradict each other?
    must_be_able_to_store_curried_functions
    auto a = add(1)(2); a(3) == 6
    Expected: equal to 6
    Actual: 3
    //////
    must_be_able_to_store_values
    auto a = add(1)(2); a(3); a == 3
    auto b = add(3)(4); b == 7
    Test Passed