<commit_before>var rpn = require('../');
var test = require('tape');

test('exports', function(t) {
  t.plan(1);

  t.ok(typeof rpn === 'function');
});

test('works', function(t) {
  var EXPRESSIONS = [
    ['0', 0],
    ['3 4 +', 7],
    ['3 4 - 5 +', 4],
    ['4 5 + 6 *', 54],
    ['6 4 5 + *', 54],
    ['2 2 3 3 / * /', 1],
    ['5 1 2 + 4 * + 3 -', 14]
  ];

  t.plan(EXPRESSIONS.length);

  EXPRESSIONS.forEach(function(expression) {
    t.equal(rpn(expression[0]), expression[1]);
  });
});

test('throws on insufficient values', function(t) {
  t.plan(1);

  t.throws(rpn.bind(null, '3 +'), 'Insufficient values in expression.');
});<commit_msg>Add float test<commit_after>var rpn = require('../');
var test = require('tape');

test('exports', function(t) {
  t.plan(1);

  t.ok(typeof rpn === 'function');
});

test('works', function(t) {
  var EXPRESSIONS = [
    ['0', 0],
    ['3 4 +', 7],
    ['3.5 4.5 +', 8],
    ['3 4 - 5 +', 4],
    ['4 5 + 6 *', 54],
    ['6 4 5 + *', 54],
    ['2 2 3 3 / * /', 1],
    ['5 1 2 + 4 * + 3 -', 14]
  ];

  t.plan(EXPRESSIONS.length);

  EXPRESSIONS.forEach(function(expression) {
    t.equal(rpn(expression[0]), expression[1]);
  });
});

test('throws on insufficient values', function(t) {
  t.plan(1);

  t.throws(rpn.bind(null, '3 +'), 'Insufficient values in expression.');
});
{'fraction_non_alphanumeric': 0.25131282820705175, 'fraction_numerical': 0.05776444111027757, 'mean_word_length': 2.9584569732937687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7078498', 'n_tokens_mistral': 588, 'n_tokens_neox': 521, 'n_words': 125}