@use 'sass:map';
@use '../../dist/include-media' as *;
@use 'pkg:sass-true' as *;

$tests-parse-expression: map.merge($media-expressions, (
  '>phone': '(min-width: 321px)',
  '<phone': '(max-width: 319px)',
  '>=phone': '(min-width: 320px)',
  '≥phone': '(min-width: 320px)',
  '<=phone': '(max-width: 320px)',
  '≤phone': '(max-width: 320px)',

  '>tablet': '(min-width: 769px)',
  '<tablet': '(max-width: 767px)',
  '>=tablet': '(min-width: 768px)',
  '≥tablet': '(min-width: 768px)',
  '<=tablet': '(max-width: 768px)',
  '≤tablet': '(max-width: 768px)',

  '>desktop': '(min-width: 1025px)',
  '<desktop': '(max-width: 1023px)',
  '>=desktop': '(min-width: 1024px)',
  '≥desktop': '(min-width: 1024px)',
  '<=desktop': '(max-width: 1024px)',
  '≤desktop': '(max-width: 1024px)'
));

@include test-module('Expression') {

  @include test('parse-expression [expression]') {
    @each $assert, $expect in $tests-parse-expression {
      @include assert-equal(parse-expression($assert), $expect, 'Must be equal');
    }
  }
}
