<commit_before>var IngredientParser = require('../domain/parser');
var assert = require('assert');

describe("parser", function() {
  it("should parse simple ingredient lines", function() {
    var parser = new IngredientParser("1 cup flour");
    var amount = parser.amount;
    assert.equal(amount.quantity, 1)
    assert.equal(amount.unit.name, 'cup')
    assert.equal(amount.ingredientName, 'flour')
  });

  it("should parse ingredient lines with 'of'", function() {
    var parser = new IngredientParser("1 cup of flour");
    var amount = parser.amount;
    assert.equal(amount.quantity, 1)
    assert.equal(amount.unit.name, 'cup')
    assert.equal(amount.ingredientName, 'flour')
  });
  
});

//test plurals
//test reducing
//test scaling
//test different patterns<commit_msg>add scaling tests<commit_after>var IngredientParser = require('../domain/parser');
var assert = require('assert');

describe("parser", function() {
  it("should parse simple ingredient lines", function() {
    var parser = new IngredientParser("1 cup flour");
    var amount = parser.amount;
    assert.equal(amount.quantity, 1)
    assert.equal(amount.unit.name, 'cup')
    assert.equal(amount.ingredientName, 'flour')
  });

  it("should parse ingredient lines with 'of'", function() {
    var parser = new IngredientParser("1 cup of flour");
    var amount = parser.amount;
    assert.equal(amount.quantity, 1)
    assert.equal(amount.unit.name, 'cup')
    assert.equal(amount.ingredientName, 'flour')
  });

  it("should scale ingredient lines", function() {
    var parser = new IngredientParser("1 cup of flour");
    var amount = parser.amount
    var scaled = amount.amountByScaling(3)
    
    assert.equal(scaled.quantity, 3)
    assert.equal(scaled.unit.name, 'cup')
    assert.equal(scaled.ingredientName, 'flour')
  });
  
  
  
});

//test plurals
//test reducing
//test scaling
//test different patterns
{'fraction_non_alphanumeric': 0.14495798319327732, 'fraction_numerical': 0.005777310924369748, 'mean_word_length': 3.897172236503856, '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': '5725397', 'n_tokens_mistral': 596, 'n_tokens_neox': 574, 'n_words': 147}