Ad
  • Custom User Avatar

    Haskell tests generate strings outside of ASCII range. Fork here fixes it, along with updating the tests so failure messages are more 7kyu-friendly and show the tested string without the QuickCheck modifier cruft.

  • Custom User Avatar

    No random tests in CoffeeScript

  • Custom User Avatar

    Sample tests of all languages should follow the Python setup by including test cases for

    • Array of numbers

    • Array of strings

    • Empty String

    • Empty Array

  • Custom User Avatar

    No random tests in TS

  • Custom User Avatar
  • Custom User Avatar

    In c++ it keeps failing with exit code 132, eventhough the tests seem to pass and the log is empty.
    I tried to google exit code 132, but found nothing that seemed applicable to this situation.
    Does anybody know what might be going on here?

  • Custom User Avatar
  • Default User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    A best practice when templating this kind of algorithm is to
    make it generic, i.e. pass a range or [begin,end) as template parameters...
    Indeed, the initial parameter says 'iterable' :-)
    May also test with any kind of ordered iterable, so that one may use concepts one day and return {} if the values cannot be ordered ?

  • Custom User Avatar

    There's a few missing C# test cases

    [Test]
    public void NullSequence()
    {
      Assert.That(Kata.UniqueInOrder(null), Throws.InstanceOf<ArgumentNullException>());
      // OR (undefined requirement)
      Assert.That(Kata.UniqueInOrder(null), Is.Empty)
    }
    
    [Test]
    public void NullValue()
    {
      // Breaks solutions that use default as a placeholder value
      Assert.That(Kata.UniqueInOrder(new string[]{"Hello", null, null, "world"}), Is.EqualTo(new string[]{"Hello", null, "world"}));
    }
    
    [Test]
    public void LeadingZero()
    {
      // Breaks solutions that use default as a placeholder value
      Assert.That(Kata.UniqueInOrder(new int[]{0, 1, 2, 3}), Is.EqualTo(new int[]{0, 1, 2, 3}));
    }
    
    [Test]
    public void EmptyIntegerArray()
    {
      // Breaks solutions that use default as a placeholder value
      Assert.That(Kata.UniqueInOrder(Array.Empty<int>()), Is.EqualTo(Array.Empty<int>()));
    }
    
    [Test]
    public void MixedTypes()
    {
      // Make sure solutions don't use assumptions between types
      Assert.That(Kata.UniqueInOrder(new object[]{1, "2", 2, 2, "5", "5"}), Is.EqualTo(new object[]{1, "2", 2, "5"}));
    }
    
    private class Foo
    {
      public override bool Equals(object other) => other is Foo || other is Bar;
    }
    
    private class Bar
    {
      public override bool Equals(object other) => other is Foo || other is Bar;
    }
    
    [Test]
    public void RemovesDuplicateCustomTypes()
    {
      // Make sure solutions don't use assumptions between types
      Assert.That(Kata.UniqueInOrder(new object[]{new Foo(), 1, new Bar(), new Foo(), string.Empty}).Select(res => res.GetType()), Is.EqualTo(new object[]{typeof(Foo), typeof(1), typeof(Bar), typeof(string)}));
    }
    
  • Custom User Avatar

    The sample tests in crystal expect an array of strings whereas the random tests expect an array of characters

  • Custom User Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

  • Custom User Avatar

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

  • Loading more items...