// =============================================================================
// =ALEKSI TESTS - STR-REMOVE
// =============================================================================

@import "aleksi/strings/str-remove";

@include test-module('The str-remove function')
{
  @include test('should remove found occurences of search')
  {
    @include assert-equal( str-replace('min-width', 'min-'), 'width' );
    @include assert-equal( str-replace('max-width', 'max-'), 'width' );

    @include assert-equal( str-remove('wiz', 'w'), 'iz' );
    @include assert-equal( str-remove('wiz', 'i'), 'wz' );
  }

  @include test('should leave str unchanged if search was not found')
  {
    @include assert-equal( str-remove('foo', 'x'), 'foo' );
  }
}

@include test-module('The str-remove-all function')
{
  @include test('should remove ALL occurences of search')
  {
    @include assert-equal( str-remove-all('wiz', 'i'), 'wz' );
    @include assert-equal( str-remove-all('foo', 'o'), 'f' );
    @include assert-equal( str-remove-all('foofoofoo', 'o'), 'fff' );
  }

  @include test('should leave str unchanged if search was not found')
  {
    @include assert-equal( str-remove-all('foo', 'x'), 'foo' );
  }
}