Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created April 9, 2014 15:38
Show Gist options
  • Save adilakhter/10284201 to your computer and use it in GitHub Desktop.
Save adilakhter/10284201 to your computer and use it in GitHub Desktop.
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