Created
April 9, 2014 15:38
-
-
Save adilakhter/10284201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("Parse /Customers?$top=2&$filter=concat(City, Country) eq 'Berlin, Germany'"){ | |
val uri = "http://odata.io/odata.svc/Schema(231)/Customer?$top=2&$filter=concat(City, Country) eq 'Berlin, Germany'" | |
val actual = p.parseThis(mainParser,uri).get | |
println(uri + "=>" + actual) | |
val expectedAst= | |
ODataQuery( | |
URL("http://odata.io/odata.svc"), | |
ResourcePath("Schema",Number("231"),ResourcePath("Customer",EmptyExp(),EmptyExp())), | |
QueryOperations( | |
List(Top(Number("2")), | |
Filter( | |
EqualToExp( | |
CallExp( | |
Property("concat") | |
, List(Property("City"), Property("Country")) | |
) | |
, StringLiteral("'Berlin, Germany'")))))) | |
assert(actual == expectedAst) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment