<commit_before>require_relative '../test-util'

describe 'Model::Assignment' do
  it 'should be equal' do
    x1 = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x2 = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x1.should.be.equal x2
  end

  it 'should not be equal' do
    x1 = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x2 = Assignment.new(Variable.new("X"), PioneString.new("b"))
    y1 = Assignment.new(Variable.new("Y"), PioneString.new("a"))
    y2 = Assignment.new(Variable.new("Y"), PioneString.new("b"))
    x1.should.not.be.equal x2
    x1.should.not.be.equal y1
    x1.should.not.be.equal y2
  end

  it 'should push its variable and value into variable table' do
    vtable = VariableTable.new
    x = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x.eval(vtable)
  end
end<commit_msg>Commit current work.<commit_after>require_relative '../test-util'

describe 'Model::Assignment' do
  it 'should be equal' do
    x1 = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x2 = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x1.should.be.equal x2
  end

  it 'should not be equal' do
    x1 = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x2 = Assignment.new(Variable.new("X"), PioneString.new("b"))
    y1 = Assignment.new(Variable.new("Y"), PioneString.new("a"))
    y2 = Assignment.new(Variable.new("Y"), PioneString.new("b"))
    x1.should.not.be.equal x2
    x1.should.not.be.equal y1
    x1.should.not.be.equal y2
  end

  it 'should push its variable and value into variable table' do
    vtable = VariableTable.new
    x = Assignment.new(Variable.new("X"), PioneString.new("a"))
    x.eval(vtable).should == PioneString.new("a")
  end
end
{'fraction_non_alphanumeric': 0.1697142857142857, 'fraction_numerical': 0.016, 'mean_word_length': 3.7841530054644807, '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': '2736608', 'n_tokens_mistral': 639, 'n_tokens_neox': 618, 'n_words': 128}