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

List.insertAt not working #216

Closed
pbiggar opened this issue Jul 30, 2021 · 1 comment
Closed

List.insertAt not working #216

pbiggar opened this issue Jul 30, 2021 · 1 comment

Comments

@pbiggar
Copy link
Member

pbiggar commented Jul 30, 2021

This inserted the value at the end instead of in the middle as intended.

      test("from darklang", () => {
        expect(insertAt(~index=5, ~value=1, [0, 2, 3, 4, 5, 6, 7, 8, 9]))
        |> toEqual(Eq.(list(int)), [0, 2, 3, 4, 5, 1, 6, 7, 8, 9])
      });
 FAIL  bucklescript/test/ListTest.bs.js
  ● List › insertAt › from darklang

    expect(received).toEqual(expected) // deep equality

    - Expected  - 2
    + Received  + 2

    @@ -7,19 +7,19 @@
            "tl": Object {
              "hd": 4,
              "tl": Object {
                "hd": 5,
                "tl": Object {
    -             "hd": 1,
    -             "tl": Object {
                  "hd": 6,
                  "tl": Object {
                    "hd": 7,
                    "tl": Object {
                      "hd": 8,
                      "tl": Object {
                        "hd": 9,
    +                   "tl": Object {
    +                     "hd": 1,
                          "tl": 0,
                        },
                      },
                    },
                  },
@pbiggar
Copy link
Member Author

pbiggar commented Aug 1, 2021

Fixed in #226

@pbiggar pbiggar closed this as completed Aug 1, 2021
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

1 participant