import COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE from '../../lib/system/dasherize-component-name';

QUnit.module('dasherize-component-name', function() {
  function equals(input, expected) {
    QUnit.test(`${input} -> ${expected}`, function(assert) {
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get(input), expected);
    });
  }

  equals('Foo', 'foo');
  equals('foo-bar', 'foo-bar');
  equals('FooBar', 'foo-bar');
  equals('XBlah', 'x-blah');
  equals('X-Blah', 'x-blah');
  equals('Foo::BarBaz', 'foo::bar-baz');
  equals('Foo::Bar-Baz', 'foo::bar-baz');
  equals('Foo@BarBaz', 'foo@bar-baz');
  equals('Foo@Bar-Baz', 'foo@bar-baz');
});

import COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE from '../../lib/system/dasherize-component-name';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
  'dasherize-component-name',
  class extends AbstractTestCase {
    ['@test names are correctly dasherized'](assert) {
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('Foo'), 'foo');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('foo-bar'), 'foo-bar');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('FooBar'), 'foo-bar');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('XBlah'), 'x-blah');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('X-Blah'), 'x-blah');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('Foo::BarBaz'), 'foo::bar-baz');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('Foo::Bar-Baz'), 'foo::bar-baz');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('Foo@BarBaz'), 'foo@bar-baz');
      assert.equal(COMPONENT_NAME_SIMPLE_DASHERIZE_CACHE.get('Foo@Bar-Baz'), 'foo@bar-baz');
    }
  }
);

Convert dasherize test over to new style
[CLEANUP] Convert dasherize test over to new style
