Navigation Menu

Skip to content

Commit

Permalink
Add a test for bq expression about literal field
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 23, 2012
1 parent 420297d commit 354073b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/bq-translator.test.js
Expand Up @@ -157,6 +157,8 @@ suite('BoolanQueryTranslator', function() {
temporaryDatabase = utils.createTemporaryDatabase();
context = temporaryDatabase.get();
domain = new Domain('test', context).createSync();
domain.getIndexField('literalfield').setType('literal')
.setFacetEnabled(true).setSearchEnabled(true).createSync();
});

teardown(function() {
Expand All @@ -169,16 +171,15 @@ suite('BoolanQueryTranslator', function() {
testQuery("expression",
"type:'ModelName'",
'type @ "ModelName"');
testQuery("expression for literal column",
"literalfield:'ModelName'",
'literalfield == "ModelName"');
testQuery("multiple words expression",
"type:'Model Name'",
'type @ "Model" && type @ "Name"');
testQuery("multiple words expression for literal column",
"literalfield:'Model Name'",
'literalfield == "Model Name"',
function() {
domain.getIndexField('literalfield').setType('literal')
.setFacetEnabled(true).setSearchEnabled(true).createSync();
});
'literalfield == "Model Name"');
testQuery("group: raw expressions",
"(and field1:'keyword1' field2:'keyword2' type:'ModelName')",
'(field1 @ "keyword1" && field2 @ "keyword2" && type @ "ModelName")');
Expand Down

0 comments on commit 354073b

Please sign in to comment.