|
|
@ -18,7 +18,7 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate eq with bool expr and return true' do
|
|
|
|
it 'has to evaluate eq with bool expr and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_eq_expr_boolexpr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_eq_expr_boolexpr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'true' }
|
|
|
|
parser.names = { 'character' => 'true' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -26,7 +26,7 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate eq with bool expr and return false' do
|
|
|
|
it 'has to evaluate eq with bool expr and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_eq_expr_boolexpr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_eq_expr_boolexpr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'false' }
|
|
|
|
parser.names = { 'character' => 'false' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -34,7 +34,7 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate eq with number and return true' do
|
|
|
|
it 'has to evaluate eq with number and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_eq_expr_number.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_eq_expr_number.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => '10' }
|
|
|
|
parser.names = { 'nombre' => '10' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -42,7 +42,7 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate eq with number and return false' do
|
|
|
|
it 'has to evaluate eq with number and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_eq_expr_number.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_eq_expr_number.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => '11' }
|
|
|
|
parser.names = { 'nombre' => '11' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -50,7 +50,7 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate eq with string and return true' do
|
|
|
|
it 'has to evaluate eq with string and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_eq_expr_string.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_eq_expr_string.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'test' }
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'Arya Stark' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -58,7 +58,7 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate eq with string and return false' do
|
|
|
|
it 'has to evaluate eq with string and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_eq_expr_string.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_eq_expr_string.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'tes' }
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'Sansa Stark' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -66,8 +66,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate true OR true and return true' do
|
|
|
|
it 'has to evaluate true OR true and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'true',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'true',
|
|
|
|
'machin' => 'true' }
|
|
|
|
'character' => 'true' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -75,8 +75,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate true OR false and return true' do
|
|
|
|
it 'has to evaluate true OR false and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'true',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'true',
|
|
|
|
'machin' => 'false' }
|
|
|
|
'character' => 'false' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -84,8 +84,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate false OR true and return true' do
|
|
|
|
it 'has to evaluate false OR true and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'false',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'false',
|
|
|
|
'machin' => 'true' }
|
|
|
|
'character' => 'true' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -93,8 +93,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate false OR false and return false' do
|
|
|
|
it 'has to evaluate false OR false and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_or_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'false',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'false',
|
|
|
|
'machin' => 'false' }
|
|
|
|
'character' => 'false' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -102,8 +102,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate true AND true and return true' do
|
|
|
|
it 'has to evaluate true AND true and return true' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'true',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'true',
|
|
|
|
'machin' => 'true' }
|
|
|
|
'character' => 'true' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
assert_equal(true, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -111,8 +111,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate true AND false and return false' do
|
|
|
|
it 'has to evaluate true AND false and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'true',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'true',
|
|
|
|
'machin' => 'false' }
|
|
|
|
'character' => 'false' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -120,8 +120,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate false AND true and return false' do
|
|
|
|
it 'has to evaluate false AND true and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'false',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'false',
|
|
|
|
'machin' => 'true' }
|
|
|
|
'character' => 'true' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -129,8 +129,8 @@ describe Mm2ep::Depend::Parser do
|
|
|
|
it 'has to evaluate false AND false and return false' do
|
|
|
|
it 'has to evaluate false AND false and return false' do
|
|
|
|
line = File
|
|
|
|
line = File
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
.read(testfile('success_simple_expr_and_expr.txt')).delete("\n")
|
|
|
|
parser.names = { 'truc_bidule' => 'false',
|
|
|
|
parser.names = { 'a_girl_has_no_name' => 'false',
|
|
|
|
'machin' => 'false' }
|
|
|
|
'character' => 'false' }
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
token = parser.parse(line.chomp)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
assert_equal(false, token.compute)
|
|
|
|
end
|
|
|
|
end
|
|
|
|