Ad
  • Custom User Avatar

    woah, okay. tried out what Chrono79 Suggested. got error and now I am confused. Any hints why could that be happening?
    Test Failed
    Expected string length 217 but was 230. Strings differ at index 147.
    Expected: "...9000000000000 + 70000000000 + 8000000000 + 50000000 + 3000..."
    But was: "...9000000000000 + 70000000000 + -4000000000 + -600000000 + 5..."
    ------------------------------------------------------------------^

    Also Tried this:
    Assert.That(Kata.ExpandedForm(60000000000000009), Is.EqualTo("60000000000000000 + 9"));

    Test Failed
    Expected string length 21 but was 65. Strings differ at index 20.
    Expected: "...0000000000000 + 9"
    But was: "...0000000000000 + 40000000 + -4000000 + -20000 + 200 + -40 + -5"
    ------------------------------^

  • Custom User Avatar

    How would we know if you don't say which language you are using and you don't show your code either?
    Post it here using proper markdown and marking your post as having spoiler content if you ask for help.

  • Custom User Avatar

    AFAIK there is no problem with the tests, try writing this sample test and give it it a try with your code:

    $this->assertEquals("6000000000000000000 + 600000000000000000 + 60000000000000000 + 8000000000000000 + 500000000000000 + 70000000000000 + 9000000000000 + 70000000000 + 8000000000 + 50000000 + 3000000 + 800000 + 20000 + 2000 + 400 + 60 + 5", expanded_form(6668579078053822465));