<commit_before>'use strict';

var check = require('./check');

describe('lost-column', function() {
  it('provides 3 column layout', function() {
    check(
      'a { lost-column: 1/3; }',
      'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' +
      'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(3n) { margin-right: 0; }\n' +
      'a:nth-child(3n + 1) { clear: left; }'
    );
  });

  it('provides 2/5 column layout', function() {
    check(
      'a { lost-column: 2/5; }',
      'a { width: calc(99.99% * 2/5 - (30px - 30px * 2/5)); }\n' +
      'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(5n) { margin-right: 0; }\n' +
      'a:nth-child(5n + 1) { clear: left; }'
    );
  });

  it('can support custom cycle', function() {
    check(
      'a { lost-column: 2/4 2; }',
      'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' +
      'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(2n) { margin-right: 0; }\n' +
      'a:nth-child(2n + 1) { clear: left; }'
    );
  });

  it('supports no gutter', function() {
    check(
      'a { lost-column: 2/5 3 0; }',
      'a { width: calc(99.999999% * 2/5); }\n' +
      'a:nth-child(n) { float: left; margin-right: 0; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(3n) { margin-right: 0; }\n' +
      'a:nth-child(3n + 1) { clear: left; }'
    );
  });

  it('supports flexbox', function() {
    check(
      'a { lost-column: 2/6 3 60px flex; }',
      'a { flex: 0 0 auto; width: calc(99.99% * 2/6 - (60px - 60px * 2/6));' +
      ' }\n' +
      'a:nth-child(n) { margin-right: 60px; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(3n) { margin-right: 0; }'
    );
  });
});<commit_msg>Adds initial test for adding float: right to last cycle child to address #200<commit_after>'use strict';

var check = require('./check');

describe('lost-column', function() {
  it('provides 3 column layout', function() {
    check(
      'a { lost-column: 1/3; }',
      'a { width: calc(99.99% * 1/3 - (30px - 30px * 1/3)); }\n' +
      'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(3n) { float: right; }\n' +
      'a:nth-child(3n) { margin-right: 0; }\n' +
      'a:nth-child(3n + 1) { clear: left; }'
    );
  });

  it('provides 2/5 column layout', function() {
    check(
      'a { lost-column: 2/5; }',
      'a { width: calc(99.99% * 2/5 - (30px - 30px * 2/5)); }\n' +
      'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(5n) { float: right; }\n' +
      'a:nth-child(5n) { margin-right: 0; }\n' +
      'a:nth-child(5n + 1) { clear: left; }'
    );
  });

  it('can support custom cycle', function() {
    check(
      'a { lost-column: 2/4 2; }',
      'a { width: calc(99.99% * 2/4 - (30px - 30px * 2/4)); }\n' +
      'a:nth-child(n) { float: left; margin-right: 30px; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(2n) { float: right; }\n' +
      'a:nth-child(2n) { margin-right: 0; }\n' +
      'a:nth-child(2n + 1) { clear: left; }'
    );
  });

  it('supports no gutter', function() {
    check(
      'a { lost-column: 2/5 3 0; }',
      'a { width: calc(99.999999% * 2/5); }\n' +
      'a:nth-child(n) { float: left; margin-right: 0; clear: none; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(3n) { float: right; }\n' +
      'a:nth-child(3n) { margin-right: 0; }\n' +
      'a:nth-child(3n + 1) { clear: left; }'
    );
  });

  it('supports flexbox', function() {
    check(
      'a { lost-column: 2/6 3 60px flex; }',
      'a { flex: 0 0 auto; width: calc(99.99% * 2/6 - (60px - 60px * 2/6));' +
      ' }\n' +
      'a:nth-child(n) { margin-right: 60px; }\n' +
      'a:last-child { margin-right: 0; }\n' +
      'a:nth-child(3n) { float: right; }\n' +
      'a:nth-child(3n) { margin-right: 0; }'
    );
  });
});
{'fraction_non_alphanumeric': 0.2380729653882133, 'fraction_numerical': 0.05378858746492049, 'mean_word_length': 2.2303625377643503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4398210', 'n_tokens_mistral': 1981, 'n_tokens_neox': 1822, 'n_words': 407}