<commit_before>// Test Assertions
// ===============


// Is Truthy
@include test-module('Is Truthy') {
  @include test('True is truthy') {
    @include assert-equal(
      _true-is-truthy(true),
      true);
  }

  @include test('String is truthy') {
    @include assert-equal(
      _true-is-truthy('string'),
      true);
  }

  @include test('List is truthy') {
    @include assert-equal(
      _true-is-truthy('one' 'two' 'three'),
      true);
  }

  @include test('False is not truthy') {
    @include assert-equal(
       _true-is-truthy(false),
        false);
  }

  @include test('Null is not truthy') {
    @include assert-equal(
      _true-is-truthy(null),
      false);
  }

  @include test('Empty string is not truthy') {
    @include assert-equal(
      _true-is-truthy(''),
      false);
  }

  @include test('Empty list is not truthy') {
    $list: ();

    @include assert-equal(
      _true-is-truthy($list),
      false);
  }
}


// Assert True
@include test-module('Assert True') {
  @include test('Truthiness') {
    @include assert-true(
      'this string',
      'Non-false properties return true.');
  }
}


// Assert False
@include test-module('Assert False') {
  @include test('Falsiness') {
    @include assert-false(
      not 'anything',
        'Negated properties return false.');
  }

  @include test('null') {
    @include assert-false(
      null,
      'Null properties return false.');
  }

  @include test('Empty string') {
    @include assert-false(
      '',
      'Empty string return false.')
  }

  @include test('empty list') {
    $empty: ();

    @include assert-false(
      $empty,
      'Empty lists return false.');
  }
}


// Assert Equal
@include test-module('Assert Equal') {
  @include test('Equality') {
    @include assert-equal(
      2 - 1,
      1,
      '2 - 1 should equal 1.');
  }

  @include test('Empty description') {
    @include assert-equal(1, 1);
  }

  @include test('Adding floats') {
    @include assert-equal(
      0.1 + 0.2,
      0.3,
      $inspect: true);
  }

  @include test('Rounded numbers with $inspect') {
    @include assert-equal(
      1/3,
      0.333333,
      $inspect: true);
  }

  @include test('Rounded colors with $inspect') {
    $origin: #246;
    $expected: #356a9f;

    @include assert-equal(
      lighten($origin, 15%),
      $expected,
      $inspect: true);
  }

  @include test('Mismatched types with $inspect') {
    @include assert-unequal(
      unquote('1rem'),
      1rem,
      'normally unequal');

    @include assert-equal(
      unquote('1rem'),
      1rem,
      $inspect: true);
  }
}


// Assert UnEqual
@include test-module('Assert UnEqual') {
  @include test('Inequality') {
    @include assert-unequal(
      3 - 1,
      3,
      '3 - 1 is not equal to 3.');
  }

  @include test('Mismatched types') {
    @include assert-unequal(
      unquote('1rem'),
      1rem);
  }

  @include test('Mismatched units with $inspect') {
    @include assert-equal(
      1,
      1rem,
      'normally equal');

    @include assert-unequal(
      1,
      1rem,
      $inspect: true);
  }
}


// Assert [output]
@include test-module('Assert (output)') {
  @include test('CSS output math') {
    @include assert('Output math compares properly') {
      @include output {
        -property1: .1 + .2;
        -property2: (1 / 3);
      }

      @include expect {
        -property1: 0.3;
        -property2: 0.33333;
      }
    }
  }

  @include test('output/expect [mixins]') {
    @include assert('Output and expected selector patterns match') {
      @include output {
        -property: value;

        @media (min-width: 30em) {
          -prop: val;

          @at-root {
            .selector {
              -prop: val;
            }
          }
        }
      }

      @include expect {
        -property: value;
        @media (min-width: 30em) {
          -prop: val;
          @at-root {
            .selector {
              -prop: val;
            }
          }
        }
      }
    }
  }

  @include test-module('Assert (contains)') {
    @include test('Passes if the property in "contains" exists in the "output" and has the same value') {
      @include assert {
        @include output {
          height: 10px;
          width: 20px;
        }

        @include contains {
          height: 10px;
        }
      }
    }

    @include test('Passes if the property and its value in class in "contains" exists in the same class in "output"') {
      @include assert {
        @include output {
          height: 20px;
          .class {
            height: 10px;
          }
          .other-class {
            height: 10px;
          }
        }

        @include contains {
          .class {
            height: 10px;
          }
        }
      }
    }

    @include test('Can be used with nested classes') {
      @include assert {
        @include output {
          height: 20px;
          .class {
            height: 10px;
            .other-class {
              height: 10px;
            }
          }
        }

        @include contains {
          .class {
            .other-class {
              height: 10px;
            }
          }
        }
      }
    }

    @include test('Can be used with nested @media queries') {
      @include assert {
        @include output {
          .class{
            height:20px;
          }
          @media (min-width: 30em) {
            @media (min-width: 40em) {
              .selector {
                height: 10px;
              }
              .selector2 {
                height: 10px;
              }
            }
            .selector3 {
              height: 10px;
            }
          }
        }

        @include contains {
          @media (min-width: 30em) {
            @media (min-width: 40em) {
              .selector2 {
                height: 10px;
              }
            }
          }
        }
      }
    }

    @include test('Can be used with @at-root') {
      @include assert {
        @include output {
          @at-root {
            .selector {
              height: 10px;
            }
          }
        }

        @include contains {
          @at-root {
            .selector {
              height: 10px;
            }
          }
        }
      }
    }

    @include test('Can be used for all selector types') {
      @include assert {
        @include output {
          .selector {
            -prop: val;
          }
          #id {
            -prop: value1;
          }
          div {
            -prop: value2;
            min-height: 20px;
            max-height: 30px;
          }

          input[type="text"] {
            color: rebeccapurple;
          }

          * + * {
            color: red;
            display: none;
          }

          body > h1 {
            font-weight: bold;
          }

          i::before {
            -prop: value3;
          }

          div ~ p {
            color: green;
          }
        }

        @include contains {
          .selector {
            -prop: val;
          }
          div {
            max-height: 30px;
          }

          body > h1 {
            font-weight: bold;
          }

          * + * {
            display: none;
          }
        }
      }
    }

    @include test('Can assert multiple properties within a selector') {
      @include assert {
        @include output {
          .selector {
            width: 10px;
            min-height: 5px;
            max-height: 20px;
          }
        }

        @include contains {
          @at-root {
            .selector {
              min-height: 5px;
              max-height: 20px;
            }
          }
        }
      }
    }
  }
}<commit_msg>Remove @at-root from expected as not used in asserted sass<commit_after>// Test Assertions
// ===============


// Is Truthy
@include test-module('Is Truthy') {
  @include test('True is truthy') {
    @include assert-equal(
      _true-is-truthy(true),
      true);
  }

  @include test('String is truthy') {
    @include assert-equal(
      _true-is-truthy('string'),
      true);
  }

  @include test('List is truthy') {
    @include assert-equal(
      _true-is-truthy('one' 'two' 'three'),
      true);
  }

  @include test('False is not truthy') {
    @include assert-equal(
       _true-is-truthy(false),
        false);
  }

  @include test('Null is not truthy') {
    @include assert-equal(
      _true-is-truthy(null),
      false);
  }

  @include test('Empty string is not truthy') {
    @include assert-equal(
      _true-is-truthy(''),
      false);
  }

  @include test('Empty list is not truthy') {
    $list: ();

    @include assert-equal(
      _true-is-truthy($list),
      false);
  }
}


// Assert True
@include test-module('Assert True') {
  @include test('Truthiness') {
    @include assert-true(
      'this string',
      'Non-false properties return true.');
  }
}


// Assert False
@include test-module('Assert False') {
  @include test('Falsiness') {
    @include assert-false(
      not 'anything',
        'Negated properties return false.');
  }

  @include test('null') {
    @include assert-false(
      null,
      'Null properties return false.');
  }

  @include test('Empty string') {
    @include assert-false(
      '',
      'Empty string return false.')
  }

  @include test('empty list') {
    $empty: ();

    @include assert-false(
      $empty,
      'Empty lists return false.');
  }
}


// Assert Equal
@include test-module('Assert Equal') {
  @include test('Equality') {
    @include assert-equal(
      2 - 1,
      1,
      '2 - 1 should equal 1.');
  }

  @include test('Empty description') {
    @include assert-equal(1, 1);
  }

  @include test('Adding floats') {
    @include assert-equal(
      0.1 + 0.2,
      0.3,
      $inspect: true);
  }

  @include test('Rounded numbers with $inspect') {
    @include assert-equal(
      1/3,
      0.333333,
      $inspect: true);
  }

  @include test('Rounded colors with $inspect') {
    $origin: #246;
    $expected: #356a9f;

    @include assert-equal(
      lighten($origin, 15%),
      $expected,
      $inspect: true);
  }

  @include test('Mismatched types with $inspect') {
    @include assert-unequal(
      unquote('1rem'),
      1rem,
      'normally unequal');

    @include assert-equal(
      unquote('1rem'),
      1rem,
      $inspect: true);
  }
}


// Assert UnEqual
@include test-module('Assert UnEqual') {
  @include test('Inequality') {
    @include assert-unequal(
      3 - 1,
      3,
      '3 - 1 is not equal to 3.');
  }

  @include test('Mismatched types') {
    @include assert-unequal(
      unquote('1rem'),
      1rem);
  }

  @include test('Mismatched units with $inspect') {
    @include assert-equal(
      1,
      1rem,
      'normally equal');

    @include assert-unequal(
      1,
      1rem,
      $inspect: true);
  }
}


// Assert [output]
@include test-module('Assert (output)') {
  @include test('CSS output math') {
    @include assert('Output math compares properly') {
      @include output {
        -property1: .1 + .2;
        -property2: (1 / 3);
      }

      @include expect {
        -property1: 0.3;
        -property2: 0.33333;
      }
    }
  }

  @include test('output/expect [mixins]') {
    @include assert('Output and expected selector patterns match') {
      @include output {
        -property: value;

        @media (min-width: 30em) {
          -prop: val;

          @at-root {
            .selector {
              -prop: val;
            }
          }
        }
      }

      @include expect {
        -property: value;
        @media (min-width: 30em) {
          -prop: val;
          @at-root {
            .selector {
              -prop: val;
            }
          }
        }
      }
    }
  }

  @include test-module('Assert (contains)') {
    @include test('Passes if the property in "contains" exists in the "output" and has the same value') {
      @include assert {
        @include output {
          height: 10px;
          width: 20px;
        }

        @include contains {
          height: 10px;
        }
      }
    }

    @include test('Passes if the property and its value in class in "contains" exists in the same class in "output"') {
      @include assert {
        @include output {
          height: 20px;
          .class {
            height: 10px;
          }
          .other-class {
            height: 10px;
          }
        }

        @include contains {
          .class {
            height: 10px;
          }
        }
      }
    }

    @include test('Can be used with nested classes') {
      @include assert {
        @include output {
          height: 20px;
          .class {
            height: 10px;
            .other-class {
              height: 10px;
            }
          }
        }

        @include contains {
          .class {
            .other-class {
              height: 10px;
            }
          }
        }
      }
    }

    @include test('Can be used with nested @media queries') {
      @include assert {
        @include output {
          .class{
            height:20px;
          }
          @media (min-width: 30em) {
            @media (min-width: 40em) {
              .selector {
                height: 10px;
              }
              .selector2 {
                height: 10px;
              }
            }
            .selector3 {
              height: 10px;
            }
          }
        }

        @include contains {
          @media (min-width: 30em) {
            @media (min-width: 40em) {
              .selector2 {
                height: 10px;
              }
            }
          }
        }
      }
    }

    @include test('Can be used with @at-root') {
      @include assert {
        @include output {
          @at-root {
            .selector {
              height: 10px;
            }
          }
        }

        @include contains {
          @at-root {
            .selector {
              height: 10px;
            }
          }
        }
      }
    }

    @include test('Can be used for all selector types') {
      @include assert {
        @include output {
          .selector {
            -prop: val;
          }
          #id {
            -prop: value1;
          }
          div {
            -prop: value2;
            min-height: 20px;
            max-height: 30px;
          }

          input[type="text"] {
            color: rebeccapurple;
          }

          * + * {
            color: red;
            display: none;
          }

          body > h1 {
            font-weight: bold;
          }

          i::before {
            -prop: value3;
          }

          div ~ p {
            color: green;
          }
        }

        @include contains {
          .selector {
            -prop: val;
          }
          div {
            max-height: 30px;
          }

          body > h1 {
            font-weight: bold;
          }

          * + * {
            display: none;
          }
        }
      }
    }

    @include test('Can assert multiple properties within a selector') {
      @include assert {
        @include output {
          .selector {
            width: 10px;
            min-height: 5px;
            max-height: 20px;
          }
        }

        @include contains {
          .selector {
            min-height: 5px;
            max-height: 20px;
          }
        }
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.12622866011381273, 'fraction_numerical': 0.0173305742369374, 'mean_word_length': 1.2900932918702799, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5897537', 'n_tokens_mistral': 4905, 'n_tokens_neox': 4634, 'n_words': 1112}