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