Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

41
LINES

< > BotCompany Repo | #1024263 // test_agiBlue_parseQueryScript (usually OK)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5362L/33K).

svoid test_agiBlue_parseQueryScript() {
  assertEqualsVerbose(unstruct([=[ [ALQLTriple(triple=T3(a="word types", b="is plural of", c="$x")), ALQLTriple(triple=T3(a="$y", b="is a", c="$x")), ALQLReturn(var="$y")] ]=]),
    agiBlue_parseQueryScript([[
      word types / is plural of / $x
      $y / is a / $x
      return $y
    ]]));
  
  assertEqualsVerbose(unstruct([=[ [ALQLLockStatement(triple=T3(a="word types", b="is plural of", c="*"))] ]=]),
    agiBlue_parseQueryScript([[
      lock { word types / is plural of / * }
    ]]));
    
  assertEqualsVerbose(unstruct([=[ [ALQLPage(page="delete slice $x", matchMethod="flexMatchDollarVarsIC_first")] ]=]),
    agiBlue_parseQueryScript([[
      page { delete slice $x }
    ]]));
    
  assertEqualsVerbose(unstruct([=[ [ALQLPage(page="bla", matchMethod="eqic")] ]=]),
    agiBlue_parseQueryScript([[
      page { bla }
    ]]));
    
  assertEqualsVerbose(unstruct([=[ [
    ALQLSlice(slice="hello", contents=[
      ALQLPage(page="bla", matchMethod="eqic"),
      ALQLPage(page="blubb", matchMethod="eqic")
    ])] ] ]=]),
    agiBlue_parseQueryScript([[
      slice "hello" {
        page { bla }
        page { blubb }
      }
    ]]));
  
  // tuple return
  assertEqualsVerbose(unstruct([=[ [ALQLReturnTuple(vars=["$x", "$y"])] ]=]),
    agiBlue_parseQueryScript([[
      return $x, $y
    ]]));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024263
Snippet name: test_agiBlue_parseQueryScript (usually OK)
Eternal ID of this version: #1024263/14
Text MD5: 04f401950e58095b774073b9d65cec2a
Transpilation MD5: f76449642d0471fac0ba07412c4a6362
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-03 16:58:19
Source code size: 1397 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 124 / 247
Version history: 13 change(s)
Referenced in: [show references]