Skip to content

Test not testing what is intended in radix-sort.spec.js #39

@Pier-LucPicard

Description

@Pier-LucPicard

Just a head up.

in test /tests/sorting/radix-sort.spec.js
If you use this construction:

    let array = Array(1000000).map(() => {
      return parseInt((Math.random() * 1000000000), 10);
    });

Like in test

 it('should work with large arrays', function() {
    this.timeout(3000);
    let array = Array(1000000).map(() => {
      return parseInt((Math.random() * 1000000000), 10);
    });
    expect(sort(array)).to.be.sorted();
  });

This returns an empty array of length 1000000 but not initialised. Therefore, it try to sort an empty array instead of an array of random integer values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions