NodeRelation label_fr_be = search("table1", "label_fr_be", rels);
NodeRelation label_en = search("table1", "label_en", rels);
NodeRelation label = search("table1", "label", rels);
Expr filterFR = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("fr"));
Expr filterEN = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("en"));
Expr filterFR_BE = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("fr-BE"));
Expr filterALL = new E_LangMatches(new E_Lang(new ExprVar("o")), NodeValue.makeString("*"));
assertEquals("LANGMATCHES(LANG(label_fr_be), \"fr\") should be TRUE", Expression.TRUE, TransformExprToSQLApplyer.convert(filterFR, label_fr_be));
assertEquals("LANGMATCHES(LANG(label_en), \"fr\") should be FALSE", Expression.FALSE, TransformExprToSQLApplyer.convert(filterFR, label_en));
assertEquals("LANGMATCHES(LANG(label_en), \"en\") should be TRUE", Expression.TRUE, TransformExprToSQLApplyer.convert(filterEN, label_en));
assertEquals("LANGMATCHES(LANG(label_fr_BE, \"fr_BE\") should be TRUE", Expression.TRUE , TransformExprToSQLApplyer.convert(filterFR_BE, label_fr_be));