eval_neutral.txt at the repository root is unchanged; this is a categorised copy carrying provenance

Το γράμμα ήτα (κεφαλαίο Η, πεζό η) είναι το έβδομο γράμμα του ελληνικού αλφαβήτου. Στο ευκλείδειο αλφάβητο κατείχε την όγδοη θέση.

Στο ελληνικό σύστημα αρίθμησης έχει αριθμητική αξία η´=8.

Προέλευση
Προέρχεται από το φοινικικό γράμμα χεθ  και σε ορισμένα τοπικά αλφάβητα της αρχαίας Ελλάδας διατήρησε και την μορφή αυτήν. Στα περισσότερα αλφάβητα συμβόλιζε τον δασύ ήχο του πνεύματος της δασείας και προφερόταν ως  (ēta). Στο ιωνικό αλφάβητο όμως, επειδή η ιωνική διάλεκτος απώλεσε τον αρχικό δασύ φθόγγο στις λέξεις («ψίλωση»), κατέληξε να προφέρεται ως  (ēta) και να συμβολίζει το μακρόχρονο φωνήεν [ē]. Όταν όμως καθιερώθηκε το ιωνικό αλφάβητο σε πολλές περιοχές της αρχαίας Ελλάδας, προέκυψε η ανάγκη να αποδίδεται με κάποιον τρόπο ο δασύς φθόγγος, μια και το ήτα ήταν πλέον [ē]. Έτσι κατέληξαν να χρησιμοποιούνται τα δύο μισά του Η, το μεν αριστερό ἧτα (├) ως δασύς φθόγγος, το δε δεξιό για να αποδώσει την έλλειψη δασύτητας ἦτα (┤). Τα πνεύματα δασεία ( ) και ψιλή () όπως τα ξέρουμε σήμερα προέκυψαν από το αριστερό και το δεξί μισό του Η αντίστοιχα.

Προφορά
Στη σύγχρονη προφορά ταυτίζεται με το ι. Η εξέλιξη αυτή στην προφορά πραγματοποιήθηκε κατά την περίοδο της κοινής ελληνικής και ονομάστηκε ιωτακισμός).

Το Η αντιστοιχεί στο λατινικό H h, όταν συμβολίζει τον ήχο της δασείας (π.χ. Ελλάς → Hellas), αλλά στο E e (π.χ. Άρης → Ares) ή στο I i, όταν συμβολίζει φωνήεν (π.χ. Αθήνα → Athina).

Το Η συμβόλιζε σε ένα αρχαιότερο ελληνικό σύστημα αρίθμησης, το ακροφωνικό σύστημα αρίθμησης, τον αριθμό 100, από το πρώτο γράμμα της λέξης  που γράφονταν ΗΕΚΑΤΟΝ → ἑκατόν (όπου το αρχικό Η αντικαταστάθηκε τελικά από το πνεύμα της δασείας).

Πηγές

Εξωτερικοί σύνδεσμοι

η


;(function() {
  'use strict';

  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  var undefined;

  /** Used as the size to cover large array optimizations. */
  var LARGE_ARRAY_SIZE = 200;

  /** Used as a reference to the global object. */
  var root = (typeof global == 'object' && global) || this;

  /** Used for native method references. */
  var arrayProto = Array.prototype;

  /** Method and object shortcuts. */
  var phantom = root.phantom,
      argv = root.process && process.argv,
      document = !phantom && root.document,
      slice = arrayProto.slice,
      WeakMap = root.WeakMap;

  /** Math helpers. */
  var add = function(x, y) { return x + y; },
      isEven = function(n) { return n % 2 == 0; },
      isEvenIndex = function(n, index) { return isEven(index); },
      square = function(n) { return n * n; };

  // Leak to avoid sporadic `noglobals` fails on Edge in Sauce Labs.
  root.msWDfn = undefined;

  /*--------------------------------------------------------------------------*/

  /** Load QUnit and extras. */
  var QUnit = root.QUnit || require('qunit-extras');

  /** Load stable Lodash. */
  var _ = root._ || require('../lodash.js');

  var convert = (function() {
    var baseConvert = root.fp || require('../fp/_baseConvert.js');
    if (!root.fp) {
      return function(name, func, options) {
        return baseConvert(_, name, func, options);
      };
    }
    return function(name, func, options) {
      if (typeof name == 'function') {
        options = func;
        func = name;
        name = undefined;
      }
      return name === undefined
        ? baseConvert(func, options)
        : baseConvert(_.runInContext(), options)[name];
    };
  }());

  var allFalseOptions = {
    'cap': false,
    'curry': false,
    'fixed': false,
    'immutable': false,
    'rearg': false
  };

  var fp = root.fp
    ? (fp = _.noConflict(), _ = root._, fp)
    : convert(_.runInContext());

  var mapping = root.mapping || require('../fp/_mapping.js');

  /*--------------------------------------------------------------------------*/

  /**
   * Skips a given number of tests with a passing result.
   *
   * @private
   * @param {Object} assert The QUnit assert object.
   * @param {number} [count=1] The number of tests to skip.
   */
  function skipAssert(assert, count) {
    count || (count = 1);
    while (count--) {
      assert.ok(true, 'test skipped');
    }
  }

  /*--------------------------------------------------------------------------*/

  if (argv) {
    console.log('Running lodash/fp tests.');
  }

  QUnit.module('convert module');

  (function() {
    QUnit.test('should work with `name` and `func`', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3, 4],
          remove = convert('remove', _.remove),
          actual = remove(isEven)(array);

      assert.deepEqual(array, [1, 2, 3, 4]);
      assert.deepEqual(actual, [1, 3]);
    });

    QUnit.test('should work with `name`, `func`, and `options`', function(assert) {
      assert.expect(3);

      var array = [1, 2, 3, 4],
          remove = convert('remove', _.remove, allFalseOptions);

      var actual = remove(array, function(n, index) {
        return isEven(index);
      });

      assert.deepEqual(array, [2, 4]);
      assert.deepEqual(actual, [1, 3]);
      assert.deepEqual(remove(), []);
    });

    QUnit.test('should work with an object', function(assert) {
      assert.expect(2);

      if (!document) {
        var array = [1, 2, 3, 4],
            lodash = convert({ 'remove': _.remove }),
            actual = lodash.remove(isEven)(array);

        assert.deepEqual(array, [1, 2, 3, 4]);
        assert.deepEqual(actual, [1, 3]);
      }
      else {
        skipAssert(assert, 2);
      }
    });

    QUnit.test('should work with an object and `options`', function(assert) {
      assert.expect(3);

      if (!document) {
        var array = [1, 2, 3, 4],
            lodash = convert({ 'remove': _.remove }, allFalseOptions),
            actual = lodash.remove(array, isEvenIndex);

        assert.deepEqual(array, [2, 4]);
        assert.deepEqual(actual, [1, 3]);
        assert.deepEqual(lodash.remove(), []);
      }
      else {
        skipAssert(assert, 3);
      }
    });

    QUnit.test('should work with lodash and `options`', function(assert) {
      assert.expect(3);

      var array = [1, 2, 3, 4],
          lodash = convert(_.runInContext(), allFalseOptions),
          actual = lodash.remove(array, isEvenIndex);

      assert.deepEqual(array, [2, 4]);
      assert.deepEqual(actual, [1, 3]);
      assert.deepEqual(lodash.remove(), []);
    });

    QUnit.test('should work with `runInContext` and `options`', function(assert) {
      assert.expect(3);

      var array = [1, 2, 3, 4],
          runInContext = convert('runInContext', _.runInContext, allFalseOptions),
          lodash = runInContext(),
          actual = lodash.remove(array, isEvenIndex);

      assert.deepEqual(array, [2, 4]);
      assert.deepEqual(actual, [1, 3]);
      assert.deepEqual(lodash.remove(), []);
    });

    QUnit.test('should accept a variety of options', function(assert) {
      assert.expect(8);

      var array = [1, 2, 3, 4],
          value = _.clone(array),
          remove = convert('remove', _.remove, { 'cap': false }),
          actual = remove(isEvenIndex)(value);

      assert.deepEqual(value, [1, 2, 3, 4]);
      assert.deepEqual(actual, [2, 4]);

      remove = convert('remove', _.remove, { 'curry': false });
      actual = remove(isEven);

      assert.deepEqual(actual, []);

      var trim = convert('trim', _.trim, { 'fixed': false });
      assert.strictEqual(trim('_-abc-_', '_-'), 'abc');

      value = _.clone(array);
      remove = convert('remove', _.remove, { 'immutable': false });
      actual = remove(isEven)(value);

      assert.deepEqual(value, [1, 3]);
      assert.deepEqual(actual, [2, 4]);

      value = _.clone(array);
      remove = convert('remove', _.remove, { 'rearg': false });
      actual = remove(value)(isEven);

      assert.deepEqual(value, [1, 2, 3, 4]);
      assert.deepEqual(actual, [1, 3]);
    });

    QUnit.test('should respect the `cap` option', function(assert) {
      assert.expect(1);

      var iteratee = convert('iteratee', _.iteratee, { 'cap': false });

      var func = iteratee(function(a, b, c) {
        return [a, b, c];
      }, 3);

      assert.deepEqual(func(1, 2, 3), [1, 2, 3]);
    });

    QUnit.test('should respect the `rearg` option', function(assert) {
      assert.expect(1);

      var add = convert('add', _.add, { 'rearg': true });

      assert.strictEqual(add('2')('1'), '12');
    });

    QUnit.test('should add a `placeholder` property', function(assert) {
      assert.expect(2);

      if (!document) {
        var lodash = convert({ 'add': _.add });

        assert.strictEqual(lodash.placeholder, lodash);
        assert.strictEqual(lodash.add.placeholder, lodash);
      }
      else {
        skipAssert(assert, 2);
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('method.convert');

  (function() {
    QUnit.test('should exist on unconverted methods', function(assert) {
      assert.expect(2);

      var array = [],
          isArray = fp.isArray.convert({ 'curry': true });

      assert.strictEqual(fp.isArray(array), true);
      assert.strictEqual(isArray()(array), true);
    });

    QUnit.test('should convert method aliases', function(assert) {
      assert.expect(1);

      var all = fp.all.convert({ 'rearg': false }),
          actual = all([0])(_.identity);

      assert.strictEqual(actual, false);
    });

    QUnit.test('should convert remapped methods', function(assert) {
      assert.expect(1);

      var extendAll = fp.extendAll.convert({ 'immutable': false }),
          object = {};

      extendAll([object, { 'a': 1 }, { 'b': 2 }]);
      assert.deepEqual(object, { 'a': 1, 'b': 2 });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('convert methods');

  _.each(['fp.convert', 'method.convert'], function(methodName) {
    var isFp = methodName == 'fp.convert',
        func = isFp ? fp.convert : fp.remove.convert;

    QUnit.test('`' + methodName + '` should work with an object', function(assert) {
      assert.expect(3);

      var array = [1, 2, 3, 4],
          lodash = func(allFalseOptions),
          remove = isFp ? lodash.remove : lodash,
          actual = remove(array, isEvenIndex);

      assert.deepEqual(array, [2, 4]);
      assert.deepEqual(actual, [1, 3]);
      assert.deepEqual(remove(), []);
    });

    QUnit.test('`' + methodName + '` should extend existing configs', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3, 4],
          lodash = func({ 'cap': false }),
          remove = (isFp ? lodash.remove : lodash).convert({ 'rearg': false }),
          actual = remove(array)(isEvenIndex);

      assert.deepEqual(array, [1, 2, 3, 4]);
      assert.deepEqual(actual, [2, 4]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('method arity checks');

  (function() {
    QUnit.test('should wrap methods with an arity > `1`', function(assert) {
      assert.expect(1);

      var methodNames = _.filter(_.functions(fp), function(methodName) {
        return fp[methodName].length > 1;
      });

      assert.deepEqual(methodNames, []);
    });

    QUnit.test('should have >= arity of `aryMethod` designation', function(assert) {
      assert.expect(4);

      _.times(4, function(index) {
        var aryCap = index + 1;

        var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) {
          var key = _.get(mapping.remap, methodName, methodName),
              arity = _[key].length;

          return arity != 0 && arity < aryCap;
        });

        assert.deepEqual(methodNames, [], '`aryMethod[' + aryCap + ']`');
      });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('method aliases');

  (function() {
    QUnit.test('should have correct aliases', function(assert) {
      assert.expect(1);

      var actual = _.transform(mapping.aliasToReal, function(result, realName, alias) {
        result.push([alias, fp[alias] === fp[realName]]);
      }, []);

      assert.deepEqual(_.reject(actual, 1), []);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('method ary caps');

  (function() {
    QUnit.test('should have a cap of 1', function(assert) {
      assert.expect(1);

      var funcMethods = [
        'curry', 'iteratee', 'memoize', 'over', 'overEvery', 'overSome',
        'method', 'methodOf', 'rest', 'runInContext'
      ];

      var exceptions = funcMethods.concat('mixin', 'nthArg', 'template'),
          expected = _.map(mapping.aryMethod[1], _.constant(true));

      var actual = _.map(mapping.aryMethod[1], function(methodName) {
        var arg = _.includes(funcMethods, methodName) ? _.noop : 1,
            result = _.attempt(function() { return fp[methodName](arg); });

        if (_.includes(exceptions, methodName)
              ? typeof result == 'function'
              : typeof result != 'function'
            ) {
          return true;
        }
        console.log(methodName, result);
        return false;
      });

      assert.deepEqual(actual, expected);
    });

    QUnit.test('should have a cap of 2', function(assert) {
      assert.expect(1);

      var funcMethods = [
        'after', 'ary', 'before', 'bind', 'bindKey', 'curryN', 'debounce',
        'delay', 'overArgs', 'partial', 'partialRight', 'rearg', 'throttle',
        'wrap'
      ];

      var exceptions = _.without(funcMethods.concat('matchesProperty'), 'delay'),
          expected = _.map(mapping.aryMethod[2], _.constant(true));

      var actual = _.map(mapping.aryMethod[2], function(methodName) {
        var args = _.includes(funcMethods, methodName) ? [methodName == 'curryN' ? 1 : _.noop, _.noop] : [1, []],
            result = _.attempt(function() { return fp[methodName](args[0])(args[1]); });

        if (_.includes(exceptions, methodName)
              ? typeof result == 'function'
              : typeof result != 'function'
            ) {
          return true;
        }
        console.log(methodName, result);
        return false;
      });

      assert.deepEqual(actual, expected);
    });

    QUnit.test('should have a cap of 3', function(assert) {
      assert.expect(1);

      var funcMethods = [
        'assignWith', 'extendWith', 'isEqualWith', 'isMatchWith', 'reduce',
        'reduceRight', 'transform', 'zipWith'
      ];

      var expected = _.map(mapping.aryMethod[3], _.constant(true));

      var actual = _.map(mapping.aryMethod[3], function(methodName) {
        var args = _.includes(funcMethods, methodName) ? [_.noop, 0, 1] : [0, 1, []],
            result = _.attempt(function() { return fp[methodName](args[0])(args[1])(args[2]); });

        if (typeof result != 'function') {
          return true;
        }
        console.log(methodName, result);
        return false;
      });

      assert.deepEqual(actual, expected);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('methods that use `indexOf`');

  (function() {
    QUnit.test('should work with `fp.indexOf`', function(assert) {
      assert.expect(10);

      var array = ['a', 'b', 'c'],
          other = ['b', 'd', 'b'],
          object = { 'a': 1, 'b': 2, 'c': 2 },
          actual = fp.difference(array)(other);

      assert.deepEqual(actual, ['a', 'c'], 'fp.difference');

      actual = fp.includes('b')(array);
      assert.strictEqual(actual, true, 'fp.includes');

      actual = fp.intersection(other)(array);
      assert.deepEqual(actual, ['b'], 'fp.intersection');

      actual = fp.omit(other)(object);
      assert.deepEqual(actual, { 'a': 1, 'c': 2 }, 'fp.omit');

      actual = fp.union(other)(array);
      assert.deepEqual(actual, ['a', 'b', 'c', 'd'], 'fp.union');

      actual = fp.uniq(other);
      assert.deepEqual(actual, ['b', 'd'], 'fp.uniq');

      actual = fp.uniqBy(_.identity, other);
      assert.deepEqual(actual, ['b', 'd'], 'fp.uniqBy');

      actual = fp.without(other)(array);
      assert.deepEqual(actual, ['a', 'c'], 'fp.without');

      actual = fp.xor(other)(array);
      assert.deepEqual(actual, ['a', 'c', 'd'], 'fp.xor');

      actual = fp.pull('b')(array);
      assert.deepEqual(actual, ['a', 'c'], 'fp.pull');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('cherry-picked methods');

  (function() {
    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(4);

      var args,
          array = [1, 2, 3],
          object = { 'a': 1, 'b': 2 },
          isFIFO = _.keys(object)[0] == 'a',
          map = convert('map', _.map),
          reduce = convert('reduce', _.reduce);

      map(function() {
        args || (args = slice.call(arguments));
      })(array);

      assert.deepEqual(args, [1]);

      args = undefined;
      map(function() {
        args || (args = slice.call(arguments));
      })(object);

      assert.deepEqual(args, isFIFO ? [1] : [2]);

      args = undefined;
      reduce(function() {
        args || (args = slice.call(arguments));
      })(0)(array);

      assert.deepEqual(args, [0, 1]);

      args = undefined;
      reduce(function() {
        args || (args = slice.call(arguments));
      })(0)(object);

      assert.deepEqual(args, isFIFO ? [0, 1] : [0, 2]);
    });

    QUnit.test('should not support shortcut fusion', function(assert) {
      assert.expect(3);

      var array = fp.range(0, LARGE_ARRAY_SIZE),
          filterCount = 0,
          mapCount = 0;

      var iteratee = function(value) {
        mapCount++;
        return value * value;
      };

      var predicate = function(value) {
        filterCount++;
        return isEven(value);
      };

      var map1 = convert('map', _.map),
          filter1 = convert('filter', _.filter),
          take1 = convert('take', _.take);

      var filter2 = filter1(predicate),
          map2 = map1(iteratee),
          take2 = take1(2);

      var combined = fp.flow(map2, filter2, fp.compact, take2);

      assert.deepEqual(combined(array), [4, 16]);
      assert.strictEqual(filterCount, 200, 'filterCount');
      assert.strictEqual(mapCount, 200, 'mapCount');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('iteratee shorthands');

  (function() {
    var objects = [{ 'a': 1, 'b': 2 }, { 'a': 3, 'b': 4 }];

    QUnit.test('should work with "_.matches" shorthands', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.filter({ 'a': 3 })(objects), [objects[1]]);
    });

    QUnit.test('should work with "_.matchesProperty" shorthands', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.filter(['a', 3])(objects), [objects[1]]);
    });

    QUnit.test('should work with "_.property" shorthands', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.map('a')(objects), [1, 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('placeholder methods');

  (function() {
    QUnit.test('should use `fp` as the default placeholder', function(assert) {
      assert.expect(3);

      var actual = fp.add(fp, 'b')('a');
      assert.strictEqual(actual, 'ab');

      actual = fp.fill(fp, 2)(1, '*')([1, 2, 3]);
      assert.deepEqual(actual, [1, '*', 3]);

      actual = fp.slice(fp, 2)(1)(['a', 'b', 'c']);
      assert.deepEqual(actual, ['b']);
    });

    QUnit.test('should support `fp.placeholder`', function(assert) {
      assert.expect(6);

      _.each([[], fp.__], function(ph) {
        fp.placeholder = ph;

        var actual = fp.add(ph, 'b')('a');
        assert.strictEqual(actual, 'ab');

        actual = fp.fill(ph, 2)(1, '*')([1, 2, 3]);
        assert.deepEqual(actual, [1, '*', 3]);

        actual = fp.slice(ph, 2)(1)(['a', 'b', 'c']);
        assert.deepEqual(actual, ['b']);
      });
    });

    var methodNames = [
      'bind',
      'bindKey',
      'curry',
      'curryRight',
      'partial',
      'partialRight'
    ];

    _.each(methodNames, function(methodName) {
      var func = fp[methodName];

      QUnit.test('fp.' + methodName + '` should have a `placeholder` property', function(assert) {
        assert.expect(2);

        assert.ok(_.isObject(func.placeholder));
        assert.strictEqual(func.placeholder, fp.__);
      });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('setter methods');

  (function() {
    QUnit.test('should only clone objects in `path`', function(assert) {
      assert.expect(11);

      var object = { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } },
          value = _.cloneDeep(object),
          actual = fp.set('a.b.c.d', 5, value);

      assert.ok(_.isObject(actual.a.b), 'fp.set');
      assert.ok(_.isNumber(actual.a.b), 'fp.set');

      assert.strictEqual(actual.a.b.c.d, 5, 'fp.set');
      assert.strictEqual(actual.d, value.d, 'fp.set');

      value = _.cloneDeep(object);
      actual = fp.setWith(Object)('[0][1]')('a')(value);

      assert.deepEqual(actual[0], { '1': 'a' }, 'fp.setWith');

      value = _.cloneDeep(object);
      actual = fp.unset('a.b')(value);

      assert.notOk('b' in actual.a, 'fp.unset');
      assert.strictEqual(actual.a.c, value.a.c, 'fp.unset');

      value = _.cloneDeep(object);
      actual = fp.update('a.b')(square)(value);

      assert.strictEqual(actual.a.b, 4, 'fp.update');
      assert.strictEqual(actual.d, value.d, 'fp.update');

      value = _.cloneDeep(object);
      actual = fp.updateWith(Object)('[0][1]')(_.constant('a'))(value);

      assert.deepEqual(actual[0], { '1': 'a' }, 'fp.updateWith');
      assert.strictEqual(actual.d, value.d, 'fp.updateWith');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.add and fp.subtract');

  _.each(['add', 'subtract'], function(methodName) {
    var func = fp[methodName],
        isAdd = methodName == 'add';

    QUnit.test('`fp.' + methodName + '` should not have `rearg` applied', function(assert) {
      assert.expect(1);

      assert.strictEqual(func('1')('2'), isAdd ? '12' : -1);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('object assignments');

  _.each(['assign', 'assignIn', 'defaults', 'defaultsDeep', 'merge'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) {
      assert.expect(2);

      var object = { 'a': 1 },
          actual = func(object)({ 'b': 2 });

      assert.deepEqual(object, { 'a': 1 });
      assert.deepEqual(actual, { 'a': 1, 'b': 2 });
    });
  });

  _.each(['assignAll', 'assignInAll', 'defaultsAll', 'defaultsDeepAll', 'mergeAll'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) {
      assert.expect(2);

      var objects = [{ 'a': 1 }, { 'b': 2 }],
          actual = func(objects);

      assert.deepEqual(objects[0], { 'a': 1 });
      assert.deepEqual(actual, { 'a': 1, 'b': 2 });
    });
  });

  _.each(['assignWith', 'assignInWith', 'extendWith'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should provide the correct `customizer` arguments', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = _.map(arguments, _.cloneDeep));
      })({ 'a': 1 })({ 'b': 2 });

      assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }]);
    });
  });

  _.each(['assignAllWith', 'assignInAllWith', 'extendAllWith', 'mergeAllWith'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should not mutate values', function(assert) {
      assert.expect(2);

      var objects = [{ 'a': 1 }, { 'b': 2 }],
          actual = func(_.noop)(objects);

      assert.deepEqual(objects[0], { 'a': 1 });
      assert.deepEqual(actual, { 'a': 1, 'b': 2 });
    });

    QUnit.test('`fp.' + methodName + '` should work with more than two sources', function(assert) {
      assert.expect(2);

      var pass = false,
          objects = [{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }],
          actual = func(function() { pass = true; })(objects);

      assert.ok(pass);
      assert.deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.castArray');

  (function() {
    QUnit.test('should shallow clone array values', function(assert) {
      assert.expect(2);

      var array = [1],
          actual = fp.castArray(array);

      assert.deepEqual(actual, array);
      assert.notStrictEqual(actual, array);
    });

    QUnit.test('should not shallow clone non-array values', function(assert) {
      assert.expect(2);

      var object = { 'a': 1 },
          actual = fp.castArray(object);

      assert.deepEqual(actual, [object]);
      assert.strictEqual(actual[0], object);
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(4);

      var array = [1],
          object = { 'a': 1 },
          castArray = convert('castArray', _.castArray),
          actual = castArray(array);

      assert.deepEqual(actual, array);
      assert.notStrictEqual(actual, array);

      actual = castArray(object);
      assert.deepEqual(actual, [object]);
      assert.strictEqual(actual[0], object);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('curry methods');

  _.each(['curry', 'curryRight'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('fp.' + methodName + '` should only accept a `func` param', function(assert) {
      assert.expect(1);

      assert.raises(function() { func(1, _.noop); }, TypeError);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('curryN methods');

  _.each(['curryN', 'curryRightN'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('fp.' + methodName + '` should accept an `arity` param', function(assert) {
      assert.expect(1);

      var actual = func(1)(function(a, b) { return [a, b]; })('a');
      assert.deepEqual(actual, ['a', undefined]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.defaultTo');

  (function() {
    QUnit.test('should have an argument order of `defaultValue` then `value`', function(assert) {
      assert.expect(2);

      assert.strictEqual(fp.defaultTo(1)(0), 0);
      assert.strictEqual(fp.defaultTo(1)(undefined), 1);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.difference');

  (function() {
    QUnit.test('should return the elements of the first array not included in the second array', function(assert) {
      assert.expect(1);

      var actual = fp.difference([2, 1], [2, 3]);
      assert.deepEqual(actual, [1]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.differenceBy');

  (function() {
    QUnit.test('should have an argument order of `iteratee`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.differenceBy(Math.floor, [2.1, 1.2], [2.3, 3.4]);
      assert.deepEqual(actual, [1.2]);
    });

    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.differenceBy(function() {
        args || (args = slice.call(arguments));
      })([2.1, 1.2], [2.3, 3.4]);

      assert.deepEqual(args, [2.3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.differenceWith');

  (function() {
    QUnit.test('should have an argument order of `comparator`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.differenceWith(fp.eq)([2, 1])([2, 3]);
      assert.deepEqual(actual, [1]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.divide and fp.multiply');

  _.each(['divide', 'multiply'], function(methodName) {
    var func = fp[methodName],
        isDivide = methodName == 'divide';

    QUnit.test('`fp.' + methodName + '` should not have `rearg` applied', function(assert) {
      assert.expect(1);

      assert.strictEqual(func('2')('4'), isDivide ? 0.5 : 8);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.extend');

  (function() {
    QUnit.test('should convert by name', function(assert) {
      assert.expect(2);

      function Foo() {}
      Foo.prototype = { 'b': 2 };

      var object = { 'a': 1 },
          extend = convert('extend', _.extend),
          actual = extend(object)(new Foo);

      assert.deepEqual(object, { 'a': 1 });
      assert.deepEqual(actual, { 'a': 1, 'b': 2 });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.fill');

  (function() {
    QUnit.test('should have an argument order of `start`, `end`, then `value`', function(assert) {
      assert.expect(1);

      var array = [1, 2, 3];
      assert.deepEqual(fp.fill(1)(2)('*')(array), [1, '*', 3]);
    });

    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3],
          actual = fp.fill(1)(2)('*')(array);

      assert.deepEqual(array, [1, 2, 3]);
      assert.deepEqual(actual, [1, '*', 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.findFrom methods');

  _.each(['findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('fp.' + methodName + '` should provide the correct `predicate` arguments', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })(1)([1, 2, 3]);

      assert.deepEqual(args, [2]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.findFrom');

  (function() {
    function resolve(value) {
      return fp.flow(fp.property('a'), fp.eq(value));
    }

    QUnit.test('should have an argument order of `value`, `fromIndex`, then `array`', function(assert) {
      assert.expect(2);

      var objects = [{ 'a': 1 }, { 'a': 2 }, { 'a': 1 }, { 'a': 2 }];

      assert.strictEqual(fp.findFrom(resolve(1))(1)(objects), objects[2]);
      assert.strictEqual(fp.findFrom(resolve(2))(-2)(objects), objects[3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.findLastFrom');

  (function() {
    function resolve(value) {
      return fp.flow(fp.property('a'), fp.eq(value));
    }

    QUnit.test('should have an argument order of `value`, `fromIndex`, then `array`', function(assert) {
      assert.expect(2);

      var objects = [{ 'a': 1 }, { 'a': 2 }, { 'a': 1 }, { 'a': 2 }];

      assert.strictEqual(fp.findLastFrom(resolve(1))(1)(objects), objects[0]);
      assert.strictEqual(fp.findLastFrom(resolve(2))(-2)(objects), objects[1]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.findIndexFrom and fp.indexOfFrom');

  _.each(['findIndexFrom', 'indexOfFrom'], function(methodName) {
    var func = fp[methodName],
        resolve = methodName == 'findIndexFrom' ? fp.eq : _.identity;

    QUnit.test('fp.' + methodName + '` should have an argument order of `value`, `fromIndex`, then `array`', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3, 1, 2, 3];

      assert.strictEqual(func(resolve(1))(2)(array), 3);
      assert.strictEqual(func(resolve(2))(-3)(array), 4);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.findLastIndexFrom and fp.lastIndexOfFrom');

  _.each(['findLastIndexFrom', 'lastIndexOfFrom'], function(methodName) {
    var func = fp[methodName],
        resolve = methodName == 'findLastIndexFrom' ? fp.eq : _.identity;

    QUnit.test('fp.' + methodName + '` should have an argument order of `value`, `fromIndex`, then `array`', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3, 1, 2, 3];

      assert.strictEqual(func(resolve(2))(3)(array), 1);
      assert.strictEqual(func(resolve(3))(-3)(array), 2);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.flatMapDepth');

  (function() {
    QUnit.test('should have an argument order of `iteratee`, `depth`, then `collection`', function(assert) {
      assert.expect(2);

      function duplicate(n) {
        return [[[n, n]]];
      }

      var array = [1, 2],
          object = { 'a': 1, 'b': 2 },
          expected = [[1, 1], [2, 2]];

      assert.deepEqual(fp.flatMapDepth(duplicate)(2)(array), expected);
      assert.deepEqual(fp.flatMapDepth(duplicate)(2)(object), expected);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('flow methods');

  _.each(['flow', 'flowRight'], function(methodName) {
    var func = fp[methodName],
        isFlow = methodName == 'flow';

    QUnit.test('`fp.' + methodName + '` should support shortcut fusion', function(assert) {
      assert.expect(6);

      var filterCount,
          mapCount,
          array = fp.range(0, LARGE_ARRAY_SIZE);

      var iteratee = function(value) {
        mapCount++;
        return square(value);
      };

      var predicate = function(value) {
        filterCount++;
        return isEven(value);
      };

      var filter = fp.filter(predicate),
          map = fp.map(iteratee),
          take = fp.take(2);

      _.times(2, function(index) {
        var combined = isFlow
          ? func(map, filter, fp.compact, take)
          : func(take, fp.compact, filter, map);

        filterCount = mapCount = 0;

        if (WeakMap && WeakMap.name) {
          assert.deepEqual(combined(array), [4, 16]);
          assert.strictEqual(filterCount, 5, 'filterCount');
          assert.strictEqual(mapCount, 5, 'mapCount');
        }
        else {
          skipAssert(assert, 3);
        }
      });
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('forEach methods');

  _.each(['forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should provide `value` to `iteratee`', function(assert) {
      assert.expect(2);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })(['a']);

      assert.deepEqual(args, ['a']);

      args = undefined;

      func(function() {
        args || (args = slice.call(arguments));
      })({ 'a': 1 });

      assert.deepEqual(args, [1]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.getOr');

  (function() {
    QUnit.test('should accept a `defaultValue` param', function(assert) {
      assert.expect(1);

      var actual = fp.getOr('default')('path')({});
      assert.strictEqual(actual, 'default');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.gt and fp.gte');

  _.each(['gt', 'gte'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) {
      assert.expect(1);

      assert.strictEqual(func(2)(1), true);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.inRange');

  (function() {
    QUnit.test('should have an argument order of `start`, `end`, then `value`', function(assert) {
      assert.expect(2);

      assert.strictEqual(fp.inRange(2)(4)(3), true);
      assert.strictEqual(fp.inRange(-2)(-6)(-3), true);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.intersectionBy');

  (function() {
    QUnit.test('should have an argument order of `iteratee`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.intersectionBy(Math.floor, [2.1, 1.2], [2.3, 3.4]);
      assert.deepEqual(actual, [2.1]);
    });

    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.intersectionBy(function() {
        args || (args = slice.call(arguments));
      })([2.1, 1.2], [2.3, 3.4]);

      assert.deepEqual(args, [2.3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.intersectionWith');

  (function() {
    QUnit.test('should have an argument order of `comparator`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.intersectionWith(fp.eq)([2, 1])([2, 3]);
      assert.deepEqual(actual, [2]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.invoke');

  (function() {
    QUnit.test('should not accept an `args` param', function(assert) {
      assert.expect(1);

      var actual = fp.invoke('toUpperCase')('a');
      assert.strictEqual(actual, 'A');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.invokeMap');

  (function() {
    QUnit.test('should not accept an `args` param', function(assert) {
      assert.expect(1);

      var actual = fp.invokeMap('toUpperCase')(['a', 'b']);
      assert.deepEqual(actual, ['A', 'B']);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.invokeArgs');

  (function() {
    QUnit.test('should accept an `args` param', function(assert) {
      assert.expect(1);

      var actual = fp.invokeArgs('concat')(['b', 'c'])('a');
      assert.strictEqual(actual, 'abc');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.invokeArgsMap');

  (function() {
    QUnit.test('should accept an `args` param', function(assert) {
      assert.expect(1);

      var actual = fp.invokeArgsMap('concat')(['b', 'c'])(['a', 'A']);
      assert.deepEqual(actual, ['abc', 'Abc']);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.isEqualWith');

  (function() {
    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      assert.expect(1);

      var args,
          iteration = 0,
          objects = [{ 'a': 1 }, { 'a': 2 }],
          stack = { '__data__': { '__data__': [objects, objects.slice().reverse()], 'size': 2 }, 'size': 2 },
          expected = [1, 2, 'a', objects[0], objects[1], stack];

      fp.isEqualWith(function() {
        if (++iteration == 2) {
          args = _.map(arguments, _.cloneDeep);
        }
      })(objects[0])(objects[1]);

      args[5] = _.omitBy(args[5], _.isFunction);
      args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction);

      assert.deepEqual(args, expected);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.isMatchWith');

  (function() {
    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      assert.expect(1);

      var args,
          objects = [{ 'a': 1 }, { 'a': 2 }],
          stack = { '__data__': { '__data__': [], 'size': 0 }, 'size': 0 },
          expected = [2, 1, 'a', objects[1], objects[0], stack];

      fp.isMatchWith(function() {
        args || (args = _.map(arguments, _.cloneDeep));
      })(objects[0])(objects[1]);

      args[5] = _.omitBy(args[5], _.isFunction);
      args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction);

      assert.deepEqual(args, expected);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.iteratee');

  (function() {
    QUnit.test('should return a iteratee with capped params', function(assert) {
      assert.expect(1);

      var func = fp.iteratee(function(a, b, c) { return [a, b, c]; }, 3);
      assert.deepEqual(func(1, 2, 3), [1, undefined, undefined]);
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(1);

      var iteratee = convert('iteratee', _.iteratee),
          func = iteratee(function(a, b, c) { return [a, b, c]; }, 3);

      assert.deepEqual(func(1, 2, 3), [1, undefined, undefined]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.lt and fp.lte');

  _.each(['lt', 'lte'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) {
      assert.expect(1);

      assert.strictEqual(func(1)(2), true);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.mapKeys');

  (function() {
    QUnit.test('should only provide `key` to `iteratee`', function(assert) {
      assert.expect(1);

      var args;

      fp.mapKeys(function() {
        args || (args = slice.call(arguments));
      }, { 'a': 1 });

      assert.deepEqual(args, ['a']);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.maxBy and fp.minBy');

  _.each(['maxBy', 'minBy'], function(methodName) {
    var array = [1, 2, 3],
        func = fp[methodName],
        isMax = methodName == 'maxBy';

    QUnit.test('`fp.' + methodName + '` should work with an `iteratee` argument', function(assert) {
      assert.expect(1);

      var actual = func(function(num) {
        return -num;
      })(array);

      assert.strictEqual(actual, isMax ? 1 : 3);
    });

    QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })(array);

      assert.deepEqual(args, [1]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.mergeWith');

  (function() {
    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      assert.expect(1);

      var args,
          stack = { '__data__': { '__data__': [], 'size': 0 }, 'size': 0 },
          expected = [[1, 2], [3], 'a', { 'a': [1, 2] }, { 'a': [3] }, stack];

      fp.mergeWith(function() {
        args || (args = _.map(arguments, _.cloneDeep));
      })({ 'a': [1, 2] })({ 'a': [3] });

      args[5] = _.omitBy(args[5], _.isFunction);
      args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction);

      assert.deepEqual(args, expected);
    });

    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var objects = [{ 'a': [1, 2] }, { 'a': [3] }],
          actual = fp.mergeWith(_.noop, objects[0], objects[1]);

      assert.deepEqual(objects[0], { 'a': [1, 2] });
      assert.deepEqual(actual, { 'a': [3, 2] });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.mergeAllWith');

  (function() {
    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      assert.expect(1);

      var args,
          objects = [{ 'a': [1, 2] }, { 'a': [3] }],
          stack = { '__data__': { '__data__': [], 'size': 0 }, 'size': 0 },
          expected = [[1, 2], [3], 'a', { 'a': [1, 2] }, { 'a': [3] }, stack];

      fp.mergeAllWith(function() {
        args || (args = _.map(arguments, _.cloneDeep));
      })(objects);

      args[5] = _.omitBy(args[5], _.isFunction);
      args[5].__data__ = _.omitBy(args[5].__data__, _.isFunction);

      assert.deepEqual(args, expected);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.mixin');

  (function() {
    var source = { 'a': _.noop };

    QUnit.test('should mixin static methods but not prototype methods', function(assert) {
      assert.expect(2);

      fp.mixin(source);

      assert.strictEqual(typeof fp.a, 'function');
      assert.notOk('a' in fp.prototype);

      delete fp.a;
      delete fp.prototype.a;
    });

    QUnit.test('should not assign inherited `source` methods', function(assert) {
      assert.expect(2);

      function Foo() {}
      Foo.prototype.a = _.noop;
      fp.mixin(new Foo);

      assert.notOk('a' in fp);
      assert.notOk('a' in fp.prototype);

      delete fp.a;
      delete fp.prototype.a;
    });

    QUnit.test('should not remove existing prototype methods', function(assert) {
      assert.expect(2);

      var each1 = fp.each,
          each2 = fp.prototype.each;

      fp.mixin({ 'each': source.a });

      assert.strictEqual(fp.each, source.a);
      assert.strictEqual(fp.prototype.each, each2);

      fp.each = each1;
      fp.prototype.each = each2;
    });

    QUnit.test('should not export to the global when `source` is not an object', function(assert) {
      assert.expect(2);

      var props = _.without(_.keys(_), '_');

      _.times(2, function(index) {
        fp.mixin.apply(fp, index ? [1] : []);

        assert.ok(_.every(props, function(key) {
          return root[key] !== fp[key];
        }));

        _.each(props, function(key) {
          if (root[key] === fp[key]) {
            delete root[key];
          }
        });
      });
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(3);

      var object = { 'mixin': convert('mixin', _.mixin) };

      function Foo() {}
      Foo.mixin = object.mixin;
      Foo.mixin(source);

      assert.ok('a' in Foo);
      assert.notOk('a' in Foo.prototype);

      object.mixin(source);
      assert.ok('a' in object);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.nthArg');

  (function() {
    QUnit.test('should return a curried function', function(assert) {
      assert.expect(2);

      var func = fp.nthArg(1);
      assert.strictEqual(func(1)(2), 2);

      func = fp.nthArg(-1);
      assert.strictEqual(func(1), 1);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.over');

  (function() {
    QUnit.test('should not cap iteratee args', function(assert) {
      assert.expect(2);

      _.each([fp.over, convert('over', _.over)], function(func) {
        var over = func([Math.max, Math.min]);
        assert.deepEqual(over(1, 2, 3, 4), [4, 1]);
      });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.omitBy and fp.pickBy');

  _.each(['omitBy', 'pickBy'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should provide `value` and `key` to `iteratee`', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })({ 'a': 1 });

      assert.deepEqual(args, [1, 'a']);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('padChars methods');

  _.each(['padChars', 'padCharsStart', 'padCharsEnd'], function(methodName) {
    var func = fp[methodName],
        isPad = methodName == 'padChars',
        isStart = methodName == 'padCharsStart';

    QUnit.test('fp.' + methodName + '` should truncate pad characters to fit the pad length', function(assert) {
      assert.expect(1);

      if (isPad) {
        assert.strictEqual(func('_-')(8)('abc'), '_-abc_-_');
      } else {
        assert.strictEqual(func('_-')(6)('abc'), isStart ? '_-_abc' : 'abc_-_');
      }
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('partial methods');

  _.each(['partial', 'partialRight'], function(methodName) {
    var func = fp[methodName],
        isPartial = methodName == 'partial';

    QUnit.test('fp.' + methodName + '` should accept an `args` param', function(assert) {
      assert.expect(1);

      var expected = isPartial ? [1, 2, 3] : [0, 1, 2];

      var actual = func(function(a, b, c) {
        return [a, b, c];
      })([1, 2])(isPartial ? 3 : 0);

      assert.deepEqual(actual, expected);
    });

    QUnit.test('fp.' + methodName + '` should convert by name', function(assert) {
      assert.expect(2);

      var expected = isPartial ? [1, 2, 3] : [0, 1, 2],
          par = convert(methodName, _[methodName]),
          ph = par.placeholder;

      var actual = par(function(a, b, c) {
        return [a, b, c];
      })([1, 2])(isPartial ? 3 : 0);

      assert.deepEqual(actual, expected);

      actual = par(function(a, b, c) {
        return [a, b, c];
      })([ph, 2])(isPartial ? 1 : 0, isPartial ? 3 : 1);

      assert.deepEqual(actual, expected);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.propertyOf');

  (function() {
    QUnit.test('should be curried', function(assert) {
      assert.expect(2);

      var object = { 'a': 1 };

      assert.strictEqual(fp.propertyOf(object, 'a'), 1);
      assert.strictEqual(fp.propertyOf(object)('a'), 1);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.pull');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3],
          actual = fp.pull(2)(array);

      assert.deepEqual(array, [1, 2, 3]);
      assert.deepEqual(actual, [1, 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.pullAll');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3],
          actual = fp.pullAll([1, 3])(array);

      assert.deepEqual(array, [1, 2, 3]);
      assert.deepEqual(actual, [2]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.pullAt');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3],
          actual = fp.pullAt([0, 2])(array);

      assert.deepEqual(array, [1, 2, 3]);
      assert.deepEqual(actual, [2]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.random');

  (function() {
    var array = Array(1000);

    QUnit.test('should support a `min` and `max` argument', function(assert) {
      assert.expect(1);

      var min = 5,
          max = 10;

      assert.ok(_.some(array, function() {
        var result = fp.random(min)(max);
        return result >= min && result <= max;
      }));
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('range methods');

  _.each(['range', 'rangeRight'], function(methodName) {
    var func = fp[methodName],
        isRange = methodName == 'range';

    QUnit.test('fp.' + methodName + '` should have an argument order of `start` then `end`', function(assert) {
      assert.expect(1);

      assert.deepEqual(func(1)(4), isRange ? [1, 2, 3] : [3, 2, 1]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('rangeStep methods');

  _.each(['rangeStep', 'rangeStepRight'], function(methodName) {
    var func = fp[methodName],
        isRange = methodName == 'rangeStep';

    QUnit.test('fp.' + methodName + '` should have an argument order of `step`, `start`, then `end`', function(assert) {
      assert.expect(1);

      assert.deepEqual(func(2)(1)(4), isRange ? [1, 3] : [3, 1]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.rearg');

  (function() {
    function fn(a, b, c) {
      return [a, b, c];
    }

    QUnit.test('should be curried', function(assert) {
      assert.expect(1);

      var rearged = fp.rearg([1, 2, 0])(fn);
      assert.deepEqual(rearged('c', 'a', 'b'), ['a', 'b', 'c']);
    });

    QUnit.test('should return a curried function', function(assert) {
      assert.expect(1);

      var rearged = fp.rearg([1, 2, 0], fn);
      assert.deepEqual(rearged('c')('a')('b'), ['a', 'b', 'c']);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('reduce methods');

  _.each(['reduce', 'reduceRight'], function(methodName) {
    var func = fp[methodName],
        isReduce = methodName == 'reduce';

    QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments when iterating an array', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })(0)([1, 2, 3]);

      assert.deepEqual(args, isReduce ? [0, 1] : [3, 0]);
    });

    QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) {
      assert.expect(1);

      var args,
          object = { 'a': 1, 'b': 2 },
          isFIFO = _.keys(object)[0] == 'a';

      var expected = isFIFO
        ? (isReduce ? [0, 1] : [2, 0])
        : (isReduce ? [0, 2] : [1, 0]);

      func(function() {
        args || (args = slice.call(arguments));
      })(0)(object);

      assert.deepEqual(args, expected);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.remove');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3],
          actual = fp.remove(fp.eq(2))(array);

      assert.deepEqual(array, [1, 2, 3]);
      assert.deepEqual(actual, [1, 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.restFrom');

  (function() {
    QUnit.test('should accept a `start` param', function(assert) {
      assert.expect(1);

      var actual = fp.restFrom(2)(function() {
        return slice.call(arguments);
      })('a', 'b', 'c', 'd');

      assert.deepEqual(actual, ['a', 'b', ['c', 'd']]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.reverse');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var array = [1, 2, 3],
          actual = fp.reverse(array);

      assert.deepEqual(array, [1, 2, 3]);
      assert.deepEqual(actual, [3, 2, 1]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.runInContext');

  (function() {
    QUnit.test('should return a converted lodash instance', function(assert) {
      assert.expect(1);

      assert.strictEqual(typeof fp.runInContext({}).curryN, 'function');
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(1);

      var runInContext = convert('runInContext', _.runInContext);
      assert.strictEqual(typeof runInContext({}).curryN, 'function');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.set');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var object = { 'a': { 'b': 2, 'c': 3 } },
          actual = fp.set('a.b')(3)(object);

      assert.deepEqual(object, { 'a': { 'b': 2, 'c': 3 } });
      assert.deepEqual(actual, { 'a': { 'b': 3, 'c': 3 } });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.setWith');

  (function() {
    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.setWith(function() {
        args || (args = _.map(arguments, _.cloneDeep));
      })('b.c')(2)({ 'a': 1 });

      assert.deepEqual(args, [undefined, 'b', { 'a': 1 }]);
    });

    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var object = { 'a': { 'b': 2, 'c': 3 } },
          actual = fp.setWith(Object)('d.e')(4)(object);

      assert.deepEqual(object, { 'a': { 'b': 2, 'c': 3 } });
      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.spreadFrom');

  (function() {
    QUnit.test('should accept a `start` param', function(assert) {
      assert.expect(1);

      var actual = fp.spreadFrom(2)(function() {
        return slice.call(arguments);
      })('a', 'b', ['c', 'd']);

      assert.deepEqual(actual, ['a', 'b', 'c', 'd']);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('trimChars methods');

  _.each(['trimChars', 'trimCharsStart', 'trimCharsEnd'], function(methodName, index) {
    var func = fp[methodName],
        parts = [];

    if (index != 2) {
      parts.push('leading');
    }
    if (index != 1) {
      parts.push('trailing');
    }
    parts = parts.join(' and ');

    QUnit.test('`fp.' + methodName + '` should remove ' + parts + ' `chars`', function(assert) {
      assert.expect(1);

      var string = '-_-a-b-c-_-',
          expected = (index == 2 ? '-_-' : '') + 'a-b-c' + (index == 1 ? '-_-' : '');

      assert.strictEqual(func('_-')(string), expected);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.unionBy');

  (function() {
    QUnit.test('should have an argument order of `iteratee`, `array`, then `other`', function(assert) {
      assert.expect(1);

      var actual = fp.unionBy(Math.floor, [2.1], [1.2, 2.3]);
      assert.deepEqual(actual, [2.1, 1.2]);
    });

    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.unionBy(function() {
        args || (args = slice.call(arguments));
      })([2.1], [1.2, 2.3]);

      assert.deepEqual(args, [2.1]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.unionWith');

  (function() {
    QUnit.test('should have an argument order of `comparator`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.unionWith(fp.eq)([2, 1])([2, 3]);
      assert.deepEqual(actual, [2, 1, 3]);
    });

    QUnit.test('should provide the correct `comparator` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.unionWith(function() {
        args || (args = slice.call(arguments));
      })([2, 1])([2, 3]);

      assert.deepEqual(args, [1, 2]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.uniqBy');

  (function() {
    var objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];

    QUnit.test('should work with an `iteratee` argument', function(assert) {
      assert.expect(1);

      var expected = objects.slice(0, 3),
          actual = fp.uniqBy(_.property('a'))(objects);

      assert.deepEqual(actual, expected);
    });

    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.uniqBy(function() {
        args || (args = slice.call(arguments));
      })(objects);

      assert.deepEqual(args, [objects[0]]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.uniqWith');

  (function() {
    QUnit.test('should have an argument order of `comparator`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.uniqWith(fp.eq)([2, 1, 2]);
      assert.deepEqual(actual, [2, 1]);
    });

    QUnit.test('should provide the correct `comparator` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.uniqWith(function() {
        args || (args = slice.call(arguments));
      })([2, 1, 2]);

      assert.deepEqual(args, [1, 2]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.update');

  (function() {
    QUnit.test('should not convert end of `path` to an object', function(assert) {
      assert.expect(1);

      var actual = fp.update('a.b')(_.identity)({ 'a': { 'b': 1 } });
      assert.strictEqual(typeof actual.a.b, 'number');
    });

    QUnit.test('should not convert uncloneables to objects', function(assert) {
      assert.expect(2);

      var object = { 'a': { 'b': _.constant(true) } },
          actual = fp.update('a.b')(_.identity)(object);

      assert.strictEqual(typeof object.a.b, 'function');
      assert.strictEqual(object.a.b, actual.a.b);
    });

    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var object = { 'a': { 'b': 2, 'c': 3 } },
          actual = fp.update('a.b')(square)(object);

      assert.deepEqual(object, { 'a': { 'b': 2, 'c': 3 } });
      assert.deepEqual(actual, { 'a': { 'b': 4, 'c': 3 } });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.updateWith');

  (function() {
    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      var args;

      fp.updateWith(function() {
        args || (args = _.map(arguments, _.cloneDeep));
      })('b.c')(_.constant(2))({ 'a': 1 });

      assert.deepEqual(args, [undefined, 'b', { 'a': 1 }]);
    });

    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var object = { 'a': { 'b': 2, 'c': 3 } },
          actual = fp.updateWith(Object)('d.e')(_.constant(4))(object);

      assert.deepEqual(object, { 'a': { 'b': 2, 'c': 3 } });
      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.unset');

  (function() {
    QUnit.test('should not mutate values', function(assert) {
      assert.expect(2);

      var object = { 'a': { 'b': 2, 'c': 3 } },
          actual = fp.unset('a.b')(object);

      assert.deepEqual(object, { 'a': { 'b': 2, 'c': 3 } });
      assert.deepEqual(actual, { 'a': { 'c': 3 } });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.xorBy');

  (function() {
    QUnit.test('should have an argument order of `iteratee`, `array`, then `other`', function(assert) {
      assert.expect(1);

      var actual = fp.xorBy(Math.floor, [2.1, 1.2], [2.3, 3.4]);
      assert.deepEqual(actual, [1.2, 3.4]);
    });

    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.xorBy(function() {
        args || (args = slice.call(arguments));
      })([2.1, 1.2], [2.3, 3.4]);

      assert.deepEqual(args, [2.3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.xorWith');

  (function() {
    QUnit.test('should have an argument order of `comparator`, `array`, then `values`', function(assert) {
      assert.expect(1);

      var actual = fp.xorWith(fp.eq)([2, 1])([2, 3]);
      assert.deepEqual(actual, [1, 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('with methods');

  _.each(['differenceWith', 'intersectionWith', 'xorWith'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`fp.' + methodName + '` should provide the correct `comparator` arguments', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })([2, 1])([2, 3]);

      assert.deepEqual(args, [2, 2]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.zip');

  (function() {
    QUnit.test('should zip together two arrays', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.zip([1, 2])([3, 4]), [[1, 3], [2, 4]]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.zipAll');

  (function() {
    QUnit.test('should zip together an array of arrays', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.zipAll([[1, 2], [3, 4], [5, 6]]), [[1, 3, 5], [2, 4, 6]]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.zipObject');

  (function() {
    QUnit.test('should zip together key/value arrays into an object', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.zipObject(['a', 'b'])([1, 2]), { 'a': 1, 'b': 2 });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.zipWith');

  (function() {
    QUnit.test('should zip arrays combining grouped elements with `iteratee`', function(assert) {
      assert.expect(1);

      var array1 = [1, 2, 3],
          array2 = [4, 5, 6],
          actual = fp.zipWith(add)(array1)(array2);

      assert.deepEqual(actual, [5, 7, 9]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.config.asyncRetries = 10;
  QUnit.config.hidepassed = true;

  if (!document) {
    QUnit.config.noglobals = true;
    QUnit.load();
    QUnit.start();
  }
}.call(this));


//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0

/**\file
 * Checks that test cases with identical name and tags are reported as error
 */

#include <catch2/catch_test_macros.hpp>

TEST_CASE("A test case with duplicated name and tags", "[tag1][tag2]") {}
TEST_CASE("A test case with duplicated name and tags", "[tag1][tag2]") {}


[package]

name = "log"
version = "0.4.33" # remember to update html_root_url
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/log"
documentation = "https://docs.rs/log"
description = """
A lightweight logging facade for Rust
"""
categories = ["development-tools::debugging"]
keywords = ["logging"]
exclude = ["rfcs/**/*"]
rust-version = "1.71.0"
edition = "2021"

[package.metadata.docs.rs]
features = ["std", "serde", "kv_std", "kv_sval", "kv_serde"]

[features]
max_level_off   = []
max_level_error = []
max_level_warn  = []
max_level_info  = []
max_level_debug = []
max_level_trace = []

release_max_level_off   = []
release_max_level_error = []
release_max_level_warn  = []
release_max_level_info  = []
release_max_level_debug = []
release_max_level_trace = []

std = []

kv = []
kv_sval = ["kv", "value-bag/sval", "sval", "sval_ref"]
kv_std = ["std", "kv", "value-bag/error"]
kv_serde = ["kv_std", "value-bag/serde", "serde"]

# This is here to not break backwards compatibility with the implicit feature
# that enables support for serde based on the dependency name. Since we're now
# using serde_core, the implicit feature was renamed, this adds back an alias.
serde = ["serde_core"]

# Deprecated: use `kv_*` instead
# These `*_unstable` features will be removed in a future release
kv_unstable = ["kv", "value-bag"]
kv_unstable_sval = ["kv_sval", "kv_unstable"]
kv_unstable_std = ["kv_std", "kv_unstable"]
kv_unstable_serde = ["kv_serde", "kv_unstable_std"]

[dependencies]
serde_core = { version = "1.0", optional = true, default-features = false }
sval = { version = "2.16", optional = true, default-features = false }
sval_ref = { version = "2.16", optional = true, default-features = false }
value-bag = { version = "1.12", optional = true, default-features = false, features = ["inline-i128"] }

[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
serde_test = { version = "1.0" }
sval = { version = "2.16" }
sval_derive = { version = "2.16" }
value-bag = { version = "1.12", features = ["test"] }

# NOTE: log doesn't actually depend on this crate. However, our dependencies,
# serde and sval, dependent on version 1.0 of the crate, which has problem fixed
# in 1.0.60, specifically in the following commit
# https://github.com/dtolnay/proc-macro2/commit/e31d61910049e097afdd3d27c37786309082bdcb.
# By defining the crate as direct dependency we can increase its minimal
# version making the minimal (crate) version CI happy.
proc-macro2 = { version = "1.0.63", default-features = false }


Aksjomat indukcji – aksjomat, a właściwie nieskończony przeliczalny zbiór aksjomatów pierwszego rzędu, pozalogicznych rozważany zwłaszcza w teorii arytmetyki liczb naturalnych. Jest on formalizacją zasady indukcji matematycznej.

Jego treść przedstawia się następująco:

gdzie  oznacza: „dla każdego n” ⇒, to wynikanie (implikacja)  oznacza „i”. Tak wyrażony aksjomat indukcji nie spełnia jednak założeń rozlicznych podejść, a w tym np. analizy Gödla niesprzeczności teorii matematycznych w szczególności arytmetyki. Problemem jest zupełna nieobliczalność relacji użytych do konstrukcji powyższego zdania: kwantyfikator ogólny „dla każdego n” nie da się bowiem zapisać jako funkcja obliczalna. Ponadto zdanie powyższe jest zdaniem drugiego rzędu z uwagi na użycie kwantyfikatora, co sprawia, że operuje ono obiektami niezdefiniowanymi w teorii (zbiorem liczb naturalnych n, z którego mamy wybierać wartości: nie można go skonstruować, zanim nie ustalimy listy aksjomatów i nie udowodnimy ich niesprzeczności).

Równoważnie aksjomat indukcji można zapisać jako koniunkcję zbioru aksjomatów w następującej postaci:

w której to notacji nie został użyty nieograniczony, a więc nieobliczalny (nierekurencyjny) kwantyfikator ogólny, wszystkie zdania są zaś pierwszego rzędu (wyrażają prawdy o zdefiniowanych wcześniej pojęciach pierwotnych arytmetyki, nie używając kwantyfikatora ogólnego). Uzyskujemy w ten sposób formalną poprawność sformułowania aksjomatu.

Aksjomaty indukcji są ważnym elementem teorii arytmetyki.

Znane są przykłady twierdzeń, w których chociaż znamy dowody twierdzenia  dla każdego  to twierdzenie  nie może być dowiedzione w ramach arytmetyki liczb naturalnych (jest niedowiedlne), gdyż każdy z tych dowodów jest prowadzony za pomocą innych narzędzi i nie da się ich sprowadzić do kroku indukcyjnego (a więc rozumowania wykazującego ), zapisanego za pomocą języka arytmetyki i obejmującego wszystkie możliwe wartości  (dla każdego n pojawia się pewien nowy element niewystępujący dla innych ).

Zobacz też
 aksjomat nieskończoności
 indukcja matematyczna

Bibliografia
 Roman Murawski, Funkcje rekurencyjne i elementy metamatematyki. Problemy zupełności, rozstrzygalności, twierdzenia Gödla, Wydawnictwo Naukowe UAM, Poznań 1990.

Logika matematyczna


# Compile-time configuration

**Contents**

[Prefixing Catch macros](#prefixing-catch-macros)

[Terminal colour](#terminal-colour)

[Console width](#console-width)

[stdout](#stdout)

[Fallback stringifier](#fallback-stringifier)

[Default reporter](#default-reporter)

[Bazel support](#bazel-support)

[C++11 toggles](#c11-toggles)

[C++17 toggles](#c17-toggles)

[Other toggles](#other-toggles)

[Enabling stringification](#enabling-stringification)

[Disabling exceptions](#disabling-exceptions)

[Disabling deprecation warnings](#disabling-deprecation-warnings)

[Overriding Catch's debug break (`-b`)](#overriding-catchs-debug-break--b)

[Static analysis support](#static-analysis-support)

[Thread safety in assertions (and messages)](#thread-safety-in-assertions-and-messages)

Catch2 is designed to "just work" as much as possible, and most of the
configuration options below are changed automatically during compilation,
according to the detected environment. However, this detection can also
be overridden by users, using macros documented below, and/or CMake options
with the same name.

## Prefixing Catch macros

    CATCH_CONFIG_PREFIX_ALL       // Prefix all macros with CATCH_
    CATCH_CONFIG_PREFIX_MESSAGES  // Prefix only message macros ((UNSCOPED_)INFO, WARN, (UNSCOPED_)CAPTURE)

To keep test code clean and uncluttered Catch uses short macro names (e.g. ```TEST_CASE``` and ```REQUIRE```). Occasionally these may conflict with identifiers from platform headers or the system under test. In this case the above identifier can be defined. This will cause all the Catch user macros to be prefixed with ```CATCH_``` (e.g. ```CATCH_TEST_CASE``` and ```CATCH_REQUIRE```).

## Terminal colour

    CATCH_CONFIG_COLOUR_WIN32     // Force enables compiling colouring impl based on Win32 console API
    CATCH_CONFIG_NO_COLOUR_WIN32  // Force disables ...

Yes, Catch2 uses the british spelling of colour.

Catch2 attempts to autodetect whether the Win32 console colouring API,
`SetConsoleTextAttribute`, is available, and if it is available it compiles
in a console colouring implementation that uses it.

This option can be used to override Catch2's autodetection and force the
compilation either ON or OFF.

## Console width

    CATCH_CONFIG_CONSOLE_WIDTH = x // where x is a number

Catch formats output intended for the console to fit within a fixed number of characters. This is especially important as indentation is used extensively and uncontrolled line wraps break this.
By default a console width of 80 is assumed but this can be controlled by defining the above identifier to be a different value.

## stdout

    CATCH_CONFIG_NOSTDOUT

To support platforms that do not provide `std::cout`, `std::cerr` and
`std::clog`, Catch does not use them directly, but rather calls
`Catch::cout`, `Catch::cerr` and `Catch::clog`. You can replace their
implementation by defining `CATCH_CONFIG_NOSTDOUT` and implementing
them yourself, their signatures are:

    std::ostream& cout();
    std::ostream& cerr();
    std::ostream& clog();

[You can see an example of replacing these functions here.](
../examples/231-Cfg-OutputStreams.cpp)

## Fallback stringifier

By default, when Catch's stringification machinery has to stringify
a type that does not specialize `StringMaker`, does not overload `operator<<`,
is not an enumeration and is not a range, it uses `"{?}"`. This can be
overridden by defining `CATCH_CONFIG_FALLBACK_STRINGIFIER` to name of a
function that should perform the stringification instead.

All types that do not provide `StringMaker` specialization or `operator<<`
overload will be sent to this function (this includes enums and ranges).
The provided function must return `std::string` and must accept any type,
e.g. via overloading.

_Note that if the provided function does not handle a type and this type
requires to be stringified, the compilation will fail._

## Default reporter

Catch's default reporter can be changed by defining macro
`CATCH_CONFIG_DEFAULT_REPORTER` to string literal naming the desired
default reporter.

This means that defining `CATCH_CONFIG_DEFAULT_REPORTER` to `"console"`
is equivalent with the out-of-the-box experience.

## Bazel support

Compiling Catch2 with `CATCH_CONFIG_BAZEL_SUPPORT` force-enables Catch2's
support for Bazel's environment variables (normally Catch2 looks for
`BAZEL_TEST=1` env var first).

This can be useful if you are using older versions of Bazel, that do not
yet have `BAZEL_TEST` env var support.

> `CATCH_CONFIG_BAZEL_SUPPORT` was [introduced](https://github.com/catchorg/Catch2/pull/2399) in Catch2 3.0.1.

> `CATCH_CONFIG_BAZEL_SUPPORT` was [deprecated](https://github.com/catchorg/Catch2/pull/2459) in Catch2 3.1.0.

## C++11 toggles

    CATCH_CONFIG_CPP11_TO_STRING // Use `std::to_string`

Because we support platforms whose standard library does not contain
`std::to_string`, it is possible to force Catch to use a workaround
based on `std::stringstream`. On platforms other than Android,
the default is to use `std::to_string`. On Android, the default is to
use the `stringstream` workaround. As always, it is possible to override
Catch's selection, by defining either `CATCH_CONFIG_CPP11_TO_STRING` or
`CATCH_CONFIG_NO_CPP11_TO_STRING`.

## C++17 toggles

    CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS  // Override std::uncaught_exceptions (instead of std::uncaught_exception) support detection
    CATCH_CONFIG_CPP17_STRING_VIEW          // Override std::string_view support detection (Catch provides a StringMaker specialization by default)
    CATCH_CONFIG_CPP17_VARIANT              // Override std::variant support detection (checked by CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER)
    CATCH_CONFIG_CPP17_OPTIONAL             // Override std::optional support detection (checked by CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER)
    CATCH_CONFIG_CPP17_BYTE                 // Override std::byte support detection (Catch provides a StringMaker specialization by default)

> `CATCH_CONFIG_CPP17_STRING_VIEW` was [introduced](https://github.com/catchorg/Catch2/issues/1376) in Catch2 2.4.1.

Catch contains basic compiler/standard detection and attempts to use
some C++17 features whenever appropriate. This automatic detection
can be manually overridden in both directions, that is, a feature
can be enabled by defining the macro in the table above, and disabled
by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`.

## Other toggles

    CATCH_CONFIG_COUNTER                    // Use __COUNTER__ to generate unique names for test cases
    CATCH_CONFIG_WINDOWS_SEH                // Enable SEH handling on Windows
    CATCH_CONFIG_FAST_COMPILE               // Sacrifices some (rather minor) features for compilation speed
    CATCH_CONFIG_POSIX_SIGNALS              // Enable handling POSIX signals
    CATCH_CONFIG_WINDOWS_CRTDBG             // Enable leak checking using Windows's CRT Debug Heap
    CATCH_CONFIG_DISABLE_STRINGIFICATION    // Disable stringifying the original expression
    CATCH_CONFIG_DISABLE                    // Disables assertions and test case registration
    CATCH_CONFIG_WCHAR                      // Enables use of wchart_t
    CATCH_CONFIG_EXPERIMENTAL_REDIRECT      // Enables the new (experimental) way of capturing stdout/stderr
    CATCH_CONFIG_USE_ASYNC                  // Force parallel statistical processing of samples during benchmarking
    CATCH_CONFIG_ANDROID_LOGWRITE           // Use android's logging system for debug output
    CATCH_CONFIG_GLOBAL_NEXTAFTER           // Use nextafter{,f,l} instead of std::nextafter
    CATCH_CONFIG_GETENV                     // System has a working `getenv`
    CATCH_CONFIG_USE_BUILTIN_CONSTANT_P     // Use __builtin_constant_p to trigger warnings

> [`CATCH_CONFIG_ANDROID_LOGWRITE`](https://github.com/catchorg/Catch2/issues/1743) and [`CATCH_CONFIG_GLOBAL_NEXTAFTER`](https://github.com/catchorg/Catch2/pull/1739) were introduced in Catch2 2.10.0

> `CATCH_CONFIG_GETENV` was [introduced](https://github.com/catchorg/Catch2/pull/2562) in Catch2 3.2.0

> `CATCH_CONFIG_USE_BUILTIN_CONSTANT_P` was introduced in Catch2 3.8.0

Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support.

`CATCH_CONFIG_POSIX_SIGNALS` is on by default, except when Catch is compiled under `Cygwin`, where it is disabled by default (but can be force-enabled by defining `CATCH_CONFIG_POSIX_SIGNALS`).

`CATCH_CONFIG_GETENV` is on by default, except when Catch2 is compiled for
platforms that lacks working `std::getenv` (currently Windows UWP and
Playstation).

`CATCH_CONFIG_WINDOWS_CRTDBG` is off by default. If enabled, Windows's
CRT is used to check for memory leaks, and displays them after the tests
finish running. This option only works when linking against the default
main, and must be defined for the whole library build.

`CATCH_CONFIG_WCHAR` is on by default, but can be disabled. Currently
it is only used in support for DJGPP cross-compiler.

With the exception of `CATCH_CONFIG_EXPERIMENTAL_REDIRECT`,
these toggles can be disabled by using `_NO_` form of the toggle,
e.g. `CATCH_CONFIG_NO_WINDOWS_SEH`.

`CATCH_CONFIG_USE_BUILTIN_CONSTANT_P` is ON by default for Clang and GCC
(but as far as possible, not for other compilers masquerading for these
two). However, it can cause bugs where the enclosed code is evaluated, even
though it should not be, e.g. in [#2925](https://github.com/catchorg/Catch2/issues/2925).

### `CATCH_CONFIG_FAST_COMPILE`
This compile-time flag speeds up compilation of assertion macros by ~20%,
by disabling the generation of assertion-local try-catch blocks for
non-exception family of assertion macros ({`REQUIRE`,`CHECK`}{``,`_FALSE`, `_THAT`}).
This disables translation of exceptions thrown under these assertions, but
should not lead to false negatives.

`CATCH_CONFIG_FAST_COMPILE` has to be either defined, or not defined,
in all translation units that are linked into single test binary.

### `CATCH_CONFIG_DISABLE_STRINGIFICATION`
This toggle enables a workaround for VS 2017 bug. For details see [known limitations](limitations.md#visual-studio-2017----raw-string-literal-in-assert-fails-to-compile).

### `CATCH_CONFIG_DISABLE`
This toggle removes most of Catch from given file. This means that `TEST_CASE`s are not registered and assertions are turned into no-ops. Useful for keeping tests within implementation files (ie for functions with internal linkage), instead of in external files.

This feature is considered experimental and might change at any point.

_Inspired by Doctest's `DOCTEST_CONFIG_DISABLE`_

## Enabling stringification

By default, Catch does not stringify some types from the standard library. This is done to avoid dragging in various standard library headers by default. However, Catch does contain these and can be configured to provide them, using these macros:

    CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER     // Provide StringMaker specialization for std::pair
    CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER    // Provide StringMaker specialization for std::tuple
    CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER  // Provide StringMaker specialization for std::variant, std::monostate (on C++17)
    CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional (on C++17)
    CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS     // Defines all of the above

> `CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1380) in Catch2 2.4.1.

> `CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1510) in Catch2 2.6.0.

## Disabling exceptions

> Introduced in Catch2 2.4.0.

By default, Catch2 uses exceptions to signal errors and to abort tests
when an assertion from the `REQUIRE` family of assertions fails. We also
provide an experimental support for disabling exceptions. Catch2 should
automatically detect when it is compiled with exceptions disabled, but
it can be forced to compile without exceptions by defining

    CATCH_CONFIG_DISABLE_EXCEPTIONS

Note that when using Catch2 without exceptions, there are 2 major
limitations:

1) If there is an error that would normally be signalled by an exception,
the exception's message will instead be written to `Catch::cerr` and
`std::terminate` will be called.
2) If an assertion from the `REQUIRE` family of macros fails,
`std::terminate` will be called after the active reporter returns.

There is also a customization point for the exact behaviour of what
happens instead of exception being thrown. To use it, define

    CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER

and provide a definition for this function:

```cpp
namespace Catch {
    [[noreturn]]
    void throw_exception(std::exception const&);
}
```

## Disabling deprecation warnings

> Introduced in Catch2 3.9.0

Catch2 has started using the C++ macro `[[deprecated]]` to mark things
that are deprecated and should not be used any more. If you need to
temporarily disable these warnings, use

    CATCH_CONFIG_NO_DEPRECATION_ANNOTATIONS

Catch2 currently does not support more fine-grained deprecation warning
control, nor do we plan to.

## Overriding Catch's debug break (`-b`)

> [Introduced](https://github.com/catchorg/Catch2/pull/1846) in Catch2 2.11.2.

You can override Catch2's break-into-debugger code by defining the
`CATCH_BREAK_INTO_DEBUGGER()` macro. This can be used if e.g. Catch2 does
not know your platform, or your platform is misdetected.

The macro will be used as is, that is, `CATCH_BREAK_INTO_DEBUGGER();`
must compile and must break into debugger.

## Static analysis support

> Introduced in Catch2 3.4.0.

Some parts of Catch2, e.g. `SECTION`s, can be hard for static analysis
tools to reason about. Catch2 can change its internals to help static
analysis tools reason about the tests.

Catch2 automatically detects some static analysis tools (initial
implementation checks for clang-tidy and Coverity), but you can override
its detection (in either direction) via

```
CATCH_CONFIG_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT     // force enables static analysis help
CATCH_CONFIG_NO_EXPERIMENTAL_STATIC_ANALYSIS_SUPPORT  // force disables static analysis help
```

_As the name suggests, this is currently experimental, and thus we provide
no backwards compatibility guarantees._

**DO NOT ENABLE THIS FOR BUILDS YOU INTEND TO RUN.** The changed internals
are not meant to be runnable, only "scannable".

## Thread safety in assertions (and messages)

> Introduced in Catch2 3.9.0

> Made non-experimental in Catch2 3.12.0

Catch2 can optionally support thread-safe assertions, that means, multiple
user-spawned threads can use the assertion macros at the same time. Due
to the performance cost this imposes even on single-threaded usage, Catch2
defaults to non-thread-safe assertions.

    CATCH_CONFIG_THREAD_SAFE_ASSERTIONS     // enables thread safe assertions
    CATCH_CONFIG_NO_THREAD_SAFE_ASSERTIONS  // force-disables thread safe assertions

See [the documentation on thread safety in Catch2](thread-safety.md#top)
for details on which macros are safe and other notes.

---

[Home](Readme.md#top)


'use strict';

const _ = require('lodash');
const fs = require('fs-extra');
const glob = require('glob');
const path = require('path');

const minify = require('../common/minify.js');

/*----------------------------------------------------------------------------*/

/**
 * Creates a [fs.copy](https://github.com/jprichardson/node-fs-extra#copy)
 * function with `srcPath` and `destPath` partially applied.
 *
 * @memberOf file
 * @param {string} srcPath The path of the file to copy.
 * @param {string} destPath The path to copy the file to.
 * @returns {Function} Returns the partially applied function.
 */
function copy(srcPath, destPath) {
  return _.partial(fs.copy, srcPath, destPath);
}

/**
 * Creates an object of base name and compiled template pairs that match `pattern`.
 *
 * @memberOf file
 * @param {string} pattern The glob pattern to be match.
 * @returns {Object} Returns the object of compiled templates.
 */
function globTemplate(pattern) {
  return _.transform(glob.sync(pattern), (result, filePath) => {
    const key = path.basename(filePath, path.extname(filePath));
    result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
  }, {});
}

/**
 * Creates a `minify` function with `srcPath` and `destPath` partially applied.
 *
 * @memberOf file
 * @param {string} srcPath The path of the file to minify.
 * @param {string} destPath The path to write the file to.
 * @returns {Function} Returns the partially applied function.
 */
function min(srcPath, destPath) {
  return _.partial(minify, srcPath, destPath);
}

/**
 * Creates a [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)
 * function with `filePath` and `data` partially applied.
 *
 * @memberOf file
 * @param {string} destPath The path to write the file to.
 * @param {string} data The data to write to the file.
 * @returns {Function} Returns the partially applied function.
 */
function write(destPath, data) {
  return _.partial(fs.writeFile, destPath, data);
}

/*----------------------------------------------------------------------------*/

module.exports = {
  copy,
  globTemplate,
  min,
  write
};


Eventi

Africa
 In Ifriquya c'è la dinastia degli Ziridi

Asia
 Dinastia dei Ghaznavidi in Afghanistan

Medio Oriente
 Inizio del periodo fatimida in Egitto (fine nel 1711). La capitale dei Fatimidi è spostata al Cairo. La città raggiunge i 500 000 abitanti tra il X e l'XI secolo.
 I Fatimidi annettono la Siria, occupano Damasco ma si scontrano alla riconquista bizantina di Giovanni I Zimisce e alle divisioni arabe.

Europa
 Guerra russo-bizantina: l'esercito russo di Sviatoslav dopo avere combattuto i bulgari per conto dei Bizantini, devasta i dintorni di Costantinopoli nel 970. Poi assediano Edirne ma sono sconfitti da Barda Sclero durante la battaglia di Arcadiopoli. L'esercito è in seguito scacciato dai Balcani da un'operazione terrestre e fluviale di Giovanni I Zimisce, che annette la Bulgaria orientale (971)
 In seguito alle ambasciate di Liutprando di Cremona e alle negoziazioni di Pandulfo Testadiferro a Costantinopoli, il basileus Giovanni I Zimisce e l'imperatore Ottone I concludono la pace nel sud Italia. L'imperatore bizantino riconosce la dignità di Ottone, e il futuro Ottone II sposerà una principessa bizantina.
 Battaglia di Tourtour dei provenzali contro la fortezza di Frassineto, un rifugio sarracino.
 La Boemia è cristianizzata.

Scoperte, arte, economia
 Il califfo fatimida fa costruire un osservatorio al Cairo dove lavora Ibn Yunus

Personaggi

Note

Altri progetti

 08


(handling-files)=

# Handling Files

```{currentmodule} click
```

Click has built in features to support file and file path handling. The examples use arguments but the same principle
applies to options as well.

(file-args)=

## File Arguments

Click supports working with files with the {class}`File` type. Some notable features are:

- Support for `-` to mean a special file that refers to stdin when used for reading, and stdout when used for writing.
  This is a common pattern for POSIX command line utilities.
- Deals with `str` and `bytes` correctly for all versions of Python.

Example:

```{eval-rst}
.. click:example::

    @click.command()
    @click.argument('input', type=click.File('rb'))
    @click.argument('output', type=click.File('wb'))
    def inout(input, output):
        """Copy contents of INPUT to OUTPUT."""
        while True:
            chunk = input.read(1024)
            if not chunk:
                break
            output.write(chunk)

And from the command line:

.. click:run::

    with isolated_filesystem():
        invoke(inout, args=['-', 'hello.txt'], input=['hello'],
               terminate_input=True)
        invoke(inout, args=['hello.txt', '-'])
```

## File Path Arguments

For handling paths, the {class}`Path` type is better than a `str`. Some notable features are:

- The `exists` argument will verify whether the path exists.
- `readable`, `writable`, and `executable` can perform permission checks.
- `file_okay` and `dir_okay` allow specifying whether files/directories are accepted.
- Error messages are nicely formatted using {func}`format_filename` so any undecodable bytes will be printed nicely.

See {class}`Path` for all features.

Example:

```{eval-rst}
.. click:example::

    @click.command()
    @click.argument('filename', type=click.Path(exists=True))
    def touch(filename):
        """Print FILENAME if the file exists."""
        click.echo(click.format_filename(filename))

And from the command line:

.. click:run::

    with isolated_filesystem():
        with open('hello.txt', 'w') as f:
            f.write('Hello World!\n')
        invoke(touch, args=['hello.txt'])
        println()
        invoke(touch, args=['missing.txt'])
```

## File Opening Behaviors

The {class}`File` type attempts to be "intelligent" about when to open a file. Stdin/stdout and files opened for reading
will be opened immediately. This will give the user direct feedback when a file cannot be opened. Files opened for
writing will only be open on the first IO operation. This is done by automatically wrapping the file in a special
wrapper.

File open behavior can be controlled by the boolean kwarg `lazy`. If a file is opened lazily:

- A failure at first IO operation will happen by raising an {exc}`FileError`.
- It can help minimize resource handling confusion by lazily closing it. This is not needed for
  parameters, but is necessary for manually prompting. For manual prompts with the {func}`prompt` function you do not
  know if a stream like stdout was opened (which was already open before) or a real file was opened (that needs
  closing).

Since files opened for writing will typically empty the file, the lazy mode should only be disabled if the developer is
absolutely sure that this is intended behavior.

It is also possible to open files in atomic mode by passing `atomic=True`. In atomic mode, all writes go into a separate
file in the same folder, and upon completion, the file will be moved over to the original location. This is useful if a
file regularly read by other users is modified.


# Security Policy

## Supported versions

The following table describes the versions of this project that are currently
supported with security updates:

| Version | Supported          |
| ------- | ------------------ |
| 4.x   | :white_check_mark:   |
| 3.x   | :x:                  |
| 2.x   | :x:                  |
| 1.x   | :x:                  |

## Threat Model

To better understand which classes of vulnerabilities are considered in-scope or out-of-scope for Lodash, please review the [Lodash Threat Model](./threat-model.md).

The threat model defines Lodash’s trust boundaries and clarifies how security issues are assessed for triage and disclosure.

## Responsible disclosure security policy

A responsible disclosure policy helps protect users of the project from publicly
disclosed security vulnerabilities without a fix by employing a process where
vulnerabilities are first triaged in a private manner, and only publicly disclosed
after a reasonable time period that allows patching the vulnerability and provides
an upgrade path for users.

We kindly ask you to refrain from malicious acts that put our users, the project,
or any of the project’s team members at risk.

## Reporting a security issue

We consider the security of Lodash a top priority. But no matter how much effort
we put into security, there can still be vulnerabilities present.

If you discover a security vulnerability, please report the security issue
directly to the Lodash maintainers through the [Security tab](https://github.com/lodash/lodash/security) of the Lodash
repository.

Your efforts to responsibly disclose your findings are sincerely appreciated.

## Escalation

If you do not receive an acknowledgement of your report within 6 business days, or if you cannot find a private security contact for the project, you may escalate to the OpenJS Foundation CNA at `security@lists.openjsf.org`.

If the project acknowledges your report but does not provide any further response or engagement within 14 days, escalation is also appropriate.