(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CURRENT_DIR)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (AndOr
                          children: [
                            (C {(cd)} 
                              {
                                (DQ 
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C {(dirname)} 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name BASH_SOURCE>
                                                  bracket_op: 
                                                    (ArrayIndex
                                                      expr: (ArithWord w:{(Lit_Digits 0)})
                                                    )
                                                  spids: [65 70]
                                                )
                                              )
                                            }
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [61 72]
                                  )
                                )
                              }
                            )
                            (C {(pwd)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                    )
                  left_token: <Left_CommandSub "$(">
                  spids: [57 78]
                )
              )
            }
          spids: [55]
        )
      ]
      spids: [55]
    )
    (AndOr
      children: [
        (C {(source)} {(DQ (${ VSub_Name CURRENT_DIR) (/../integration_test_setup.sh))})
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ("integration_test_setup.sh not found!"))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[102])]
                )
              terminator: <Op_Semi ";">
            )
            (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">)
          ]
          spids: [94]
        )
      ]
      op_id: Op_DPipe
    )
    (C {(add_to_bazelrc)} {(DQ ("build --package_path=%workspace%"))})
    (FuncDef
      name: test_does_not_fail_horribly
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(peach)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(peach/BUILD)} spids:[143])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("sh_library(name='brighton', deps=[':harken'])\n") 
                        ("sh_library(name='harken')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [147]
                )
              ]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(SQ <"deps(//peach:brighton)">)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [162]
                )
              ]
            )
            (C {(expect_log)} {(DQ ("//peach:brighton"))})
            (C {(expect_log)} {(DQ ("//peach:harken"))})
          ]
          spids: [131]
        )
      spids: [125 130]
    )
    (FuncDef
      name: test_visibility_affects_xml_output
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(kiwi)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(kiwi/BUILD)} spids:[203])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("sh_library(name='kiwi', visibility=['//visibility:private'])\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [207]
                )
              ]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(--output) (Lit_Other "=") (xml)} {(SQ <"//kiwi:kiwi">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output_private)} spids:[224])]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(kiwi/BUILD)} spids:[232])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("sh_library(name='kiwi', visibility=['//visibility:public'])\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [236]
                )
              ]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(--output) (Lit_Other "=") (xml)} {(SQ <"//kiwi:kiwi">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output_public)} spids:[253])]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(kiwi/BUILD)} spids:[261])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("sh_library(name='kiwi')\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [265]
                )
              ]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(--output) (Lit_Other "=") (xml)} {(SQ <"//kiwi:kiwi">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output_none)} spids:[282])]
            )
            (AndOr
              children: [
                (C {(cmp)} {(output_private)} {(output_public)})
                (C {(fail)} {(DQ ("visibility does not affect XML output"))})
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [
                (C {(cmp)} {(output_none)} {(output_private)})
                (C {(fail)} {(DQ ("visibility does not affect XML output"))})
              ]
              op_id: Op_DAmp
            )
            (AndOr
              children: [
                (C {(cmp)} {(output_none)} {(output_public)})
                (C {(fail)} {(DQ ("visibility does not affect XML output"))})
              ]
              op_id: Op_DAmp
            )
            (C {(assert_contains)} {(DQ ("//kiwi:kiwi"))} {(output_private)})
            (C {(assert_contains)} {(DQ ("//kiwi:kiwi"))} {(output_public)})
            (C {(assert_contains)} {(DQ ("//kiwi:kiwi"))} {(output_none)})
            (C {(assert_contains)} {(DQ ("//visibility:private"))} {(output_private)})
            (C {(assert_contains)} {(DQ ("//visibility:public"))} {(output_public)})
            (C {(assert_not_contains)} {(DQ ("//visibility:private"))} {(output_none)})
            (C {(assert_not_contains)} {(DQ ("//visibility:public"))} {(output_none)})
          ]
          spids: [190]
        )
      spids: [184 189]
    )
    (FuncDef
      name: test_visibility_affects_proto_output
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(kiwi)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(kiwi/BUILD)} spids:[419])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("sh_library(name='kiwi', visibility=['//visibility:private'])\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [423]
                )
              ]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(--output) (Lit_Other "=") (proto)} {(SQ <"//kiwi:kiwi">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output_private)} spids:[440])]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(kiwi/BUILD)} spids:[448])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("sh_library(name='kiwi', visibility=['//visibility:public'])\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [452]
                )
              ]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(--output) (Lit_Other "=") (proto)} {(SQ <"//kiwi:kiwi">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output_public)} spids:[469])]
            )
            (AndOr
              children: [
                (C {(cmp)} {(output_private)} {(output_public)})
                (C {(fail)} {(DQ ("visibility does not affect proto output"))})
              ]
              op_id: Op_DAmp
            )
            (C {(assert_contains)} {(DQ ("//kiwi:kiwi"))} {(output_private)})
            (C {(assert_contains)} {(DQ ("//kiwi:kiwi"))} {(output_public)})
            (C {(assert_contains)} {(DQ ("//visibility:private"))} {(output_private)})
            (C {(assert_contains)} {(DQ ("//visibility:public"))} {(output_public)})
          ]
          spids: [406]
        )
      spids: [400 405]
    )
    (FuncDef
      name: make_depth_tests
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {(depth)} {(depth2)})
                (C {(die)} {(DQ ("Could not create test directory"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(DQ (depth/BUILD))}
                  spids: [571]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("sh_binary(name = 'one', srcs = ['one.sh'], deps = [':two'])\n") 
                        ("sh_library(name = 'two', srcs = ['two.sh'],\n") ("           deps = [':div2', ':three', '//depth2:three'])\n") 
                        ("sh_library(name = 'three', srcs = ['three.sh'], deps = [':four'])\n") ("sh_library(name = 'four', srcs = ['four.sh'], deps = [':div2', ':five'])\n") 
                        ("sh_library(name = 'five', srcs = ['five.sh'])\n") ("sh_library(name = 'div2', srcs = ['two.sh'])\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [577]
                )
              ]
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("sh_library(name = 'three', srcs = ['three.sh'])"))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(depth2/BUILD)} spids:[595])]
            )
            (C {(touch)} 
              (BracedWordTree
                parts: [(depth/) (BracedAltPart words:[{(one)}{(two)}{(three)}{(four)}{(five)}]) (.sh)]
              ) {(depth2/three.sh)}
            )
            (C {(chmod)} {(a) (Lit_Other "+") (x)} {(depth/) (Lit_Other "*") (.sh)} 
              {(depth2/) (Lit_Other "*") (.sh)}
            )
          ]
          spids: [549]
        )
      spids: [543 548]
    )
    (FuncDef
      name: assert_depth_query_idempotence
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:order_results)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [652]
                )
              ]
              spids: [652]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {($ VSub_Name "$order_results")})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(add_to_bazelrc)} {(DQ ("query --order_output=auto"))})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:universe_arg)
                          op: Equal
                          rhs: {(DQ )}
                          spids: [674]
                        )
                      ]
                      spids: [674]
                    )
                  ]
                  spids: [-1 664]
                )
              ]
              else_action: [
                (C {(add_to_bazelrc)} {(DQ ("query --order_output=no"))})
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:universe_arg)
                      op: Equal
                      rhs: 
                        {(--universe_scope) (Lit_Other "=") (//depth) (Lit_Other ":") (Lit_Other "*")}
                      spids: [689]
                    )
                  ]
                  spids: [689]
                )
              ]
              spids: [679 697]
            )
            (C {(make_depth_tests)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:last_log)
                  op: Equal
                  rhs: {(DQ ($ VSub_Name "$TEST_log") (.last))}
                  spids: [703]
                )
              ]
              spids: [703]
            )
            (ForEach
              iter_name: run
              iter_words: [{(Lit_LBrace "{") (1..5) (Lit_RBrace "}")}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(mv)} {(-f)} {($ VSub_Name "$TEST_log")} {($ VSub_Name "$last_log")})
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(bazel)}
                            {(query)}
                            {(SQ <"deps(//depth:one, 4)">)}
                            {($ VSub_Name "$universe_arg")}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: -1
                              arg_word: {($ VSub_Name "$TEST_log")}
                              spids: [747]
                            )
                          ]
                        )
                        (C {(fail)} {(DQ ("Expected success"))})
                      ]
                      op_id: Op_DPipe
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other "[")} {($ VSub_Name "$run")} {(-gt)} {(1)} 
                                  {(Lit_Other "]")}
                                )
                              terminator: <Op_Semi ";">
                            )
                          ]
                          action: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: (C {($ VSub_Name "$order_results")})
                                      terminator: <Op_Semi ";">
                                    )
                                  ]
                                  action: [
                                    (AndOr
                                      children: [
                                        (C {(diff)} {($ VSub_Name "$TEST_log")} 
                                          {($ VSub_Name "$last_log")}
                                        )
                                        (C {(fail)} 
                                          {
                                            (DQ ("Lines differed between query results: ") 
                                              ($ VSub_Name "$last_log")
                                            )
                                          }
                                        )
                                      ]
                                      op_id: Op_DPipe
                                    )
                                  ]
                                  spids: [-1 784]
                                )
                              ]
                              else_action: [
                                (AndOr
                                  children: [
                                    (C {(diff)} 
                                      {
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [(C {(sort)} {($ VSub_Name "$TEST_log")})]
                                            )
                                          left_token: <Left_ProcSubIn "<(">
                                          spids: [810 814]
                                        )
                                      } 
                                      {
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [(C {(sort)} {($ VSub_Name "$last_log")})]
                                            )
                                          left_token: <Left_ProcSubIn "<(">
                                          spids: [816 820]
                                        )
                                      }
                                    )
                                    (C {(fail)} {(DQ ("Lines differed between sorted query results"))})
                                  ]
                                  op_id: Op_DPipe
                                )
                              ]
                              spids: [805 833]
                            )
                          ]
                          spids: [-1 775]
                        )
                      ]
                      spids: [-1 836]
                    )
                  ]
                  spids: [721 839]
                )
              spids: [715 719]
            )
            (AndOr
              children: [
                (C {(rm)} {(-f)} {($ VSub_Name "$last_log")})
                (C {(die)} {(DQ ("Could not remove ") ($ VSub_Name "$last_log"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [649]
        )
      spids: [643 648]
    )
    (FuncDef
      name: test_depth_query_idempotence_ordered
      body: (BraceGroup children:[(C {(assert_depth_query_idempotence)} {(true)})] spids:[866])
      spids: [860 865]
    )
    (FuncDef
      name: test_depth_query_idempotence_unordered
      body: (BraceGroup children:[(C {(assert_depth_query_idempotence)} {(false)})] spids:[882])
      spids: [876 881]
    )
    (FuncDef
      name: test_universe_scope_with_without_star
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(foo)}) (C {(fail)} {(DQ ("Couldn't mkdir"))})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ("sh_library(name = 'foo')"))}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[922])]
                )
                (C {(fail)} {(DQ ("Couldn't write BUILD"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...)}
                    {(SQ <"//foo:BUILD">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [953]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("//foo:BUILD"))})
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...) (Lit_Other ":") (Lit_Other "*")}
                    {(SQ <"//foo:BUILD">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1010]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("//foo:BUILD"))})
          ]
          spids: [898]
        )
      spids: [892 897]
    )
    (FuncDef
      name: test_outside_universe_ok
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(foo)} {(bar)}) (C {(fail)} {(DQ ("Couldn't mkdir"))})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ("sh_library(name = 'foo', deps = ['//bar:bar'])"))}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[1065])]
                )
                (C {(fail)} {(DQ ("Couldn't write BUILD"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(cat)}]
                  redirects: [
                    (HereDoc
                      op_id: Redir_DLess
                      fd: -1
                      body: 
                        {("sh_library(name = 'bar')\n") ("sh_library(name = 'dep')\n") 
                          ("sh_library(name = 'top', deps = [':dep'])\n")
                        }
                      do_expansion: False
                      here_end: EOF
                      was_filled: True
                      spids: [1081]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(bar/BUILD)}
                      spids: [1086]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Couldn't write BUILD"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...) (Lit_Other ":") (Lit_Other "*")}
                    {(SQ <"allrdeps(//bar:BUILD)">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1119]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("//bar:BUILD"))})
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...) (Lit_Other ":") (Lit_Other "*")}
                    {(SQ <"allrdeps(//bar:dep)">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1168]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("//bar:dep"))})
            (C {(expect_not_log)} {(DQ ("//bar:top"))})
          ]
          spids: [1039]
        )
      spids: [1033 1038]
    )
    (FuncDef
      name: test_minrank_le_depth_bound
      body: 
        (BraceGroup
          children: [
            (C {(make_depth_tests)})
            (ForEach
              iter_name: depth
              iter_words: [{(Lit_LBrace "{") (5..0) (Lit_RBrace "}")}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(bazel)}
                            {(query)}
                            {(DQ ("deps(//depth:one, ") ($ VSub_Name "$depth") (")"))}
                            {(--output) (Lit_Other "=") (minrank)}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: -1
                              arg_word: {($ VSub_Name "$TEST_log")}
                              spids: [1256]
                            )
                          ]
                        )
                        (C {(fail)} {(DQ ("Expected success"))})
                      ]
                      op_id: Op_DPipe
                    )
                    (ForEach
                      iter_name: rank
                      iter_words: [
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (C {(cut)} {(-d) (SQ <" ">)} {(-f)} {(1)} {($ VSub_Name "$TEST_log")})
                                ]
                              )
                            left_token: <Left_CommandSub "$(">
                            spids: [1277 1290]
                          )
                        }
                      ]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          children: [
                            (AndOr
                              children: [
                                (C {(Lit_Other "[")} {($ VSub_Name "$rank")} {(-le)} 
                                  {($ VSub_Name "$depth")} {(Lit_Other "]")}
                                )
                                (C {(fail)} 
                                  {
                                    (DQ ("Expected max minrank of ") ($ VSub_Name "$depth") (", was ") 
                                      ($ VSub_Name "$rank")
                                    )
                                  }
                                )
                              ]
                              op_id: Op_DPipe
                            )
                          ]
                          spids: [1293 1318]
                        )
                      spids: [1276 1291]
                    )
                  ]
                  spids: [1239 1321]
                )
              spids: [1233 1237]
            )
          ]
          spids: [1222]
        )
      spids: [1216 1221]
    )
    (FuncDef
      name: test_skylark_dep_in_sky_query
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {(foo)} {(bar)})
                (C {(fail)} {(DQ ("Couldn't make directories"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(SQ <"load(\"/bar/fakerule\", \"const\")">)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[1358])]
                )
                (C {(fail)} {(DQ ("Couldn't write"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [(C {(touch)} {(bar/BUILD)}) (C {(fail)} {(DQ ("Couldn't touch bar/BUILD"))})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(SQ <"const = 2">)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(bar/fakerule.bzl)}
                      spids: [1390]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Couldn't write fakerule"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...) (Lit_Other ":") (Lit_Other "*")}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(SQ <"rbuildfiles(bar/fakerule.bzl)">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1423]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log_once)} {(DQ ("//foo:BUILD"))})
            (C {(expect_not_log)} {(DQ ("//bar:BUILD"))})
            (C {(expect_not_log)} 
              {(DQ (fakerule) (EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (bzl))}
            )
          ]
          spids: [1332]
        )
      spids: [1326 1331]
    )
    (FuncDef
      name: test_skylark_subdir_dep_in_sky_query
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {(foo)} {(bar/baz)})
                (C {(fail)} {(DQ ("Couldn't make directories"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(SQ <"load(\"/bar/baz/fakerule\", \"const\")">)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[1493])]
                )
                (C {(fail)} {(DQ ("Couldn't write"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [(C {(touch)} {(bar/BUILD)}) (C {(fail)} {(DQ ("Couldn't touch bar/BUILD"))})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(SQ <"const = 2">)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(bar/baz/fakerule.bzl)}
                      spids: [1525]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Couldn't write fakerule"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...) (Lit_Other ":") (Lit_Other "*")}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(SQ <"rbuildfiles(bar/baz/fakerule.bzl)">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1558]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log_once)} {(DQ ("//foo:BUILD"))})
            (C {(expect_not_log)} {(DQ ("//bar:BUILD"))})
            (C {(expect_not_log)} 
              {(DQ (fakerule) (EscapedLiteralPart token:<Lit_EscapedChar "\\.">) (bzl))}
            )
          ]
          spids: [1467]
        )
      spids: [1461 1466]
    )
    (FuncDef
      name: test_parent_independent_of_child
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {(foo/subdir)})
                (C {(fail)} {(DQ ("Couldn't make directories"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(SQ <"sh_library(name = \"sh\", data = glob([\"**\"]))">)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[1626])]
                )
                (C {(fail)} {(DQ ("Couldn't write"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(touch)} {(foo/subdir/BUILD)})
                (C {(fail)} {(DQ ("Couldn't touch foo/subdir/BUILD"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(query)}
                    {(--universe_scope) (Lit_Other "=") (//foo/...) (Lit_Other ":") (Lit_Other "*")}
                    {(--order_output) (Lit_Other "=") (no)}
                    {(SQ <"rbuildfiles(foo/subdir/BUILD)">)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1673]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log_once)} {(DQ ("//foo/subdir:BUILD"))})
            (C {(expect_not_log)} {(DQ ("//foo:BUILD"))})
          ]
          spids: [1602]
        )
      spids: [1596 1601]
    )
    (FuncDef
      name: test_does_not_fail_horribly_with_file
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(peach)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(peach/BUILD)} spids:[1720])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("sh_library(name='brighton', deps=[':harken'])\n") 
                        ("sh_library(name='harken')\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [1724]
                )
              ]
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("deps(//peach:brighton)"))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(query_file)} spids:[1737])]
            )
            (SimpleCommand
              words: [{(bazel)} {(query)} {(--query_file) (Lit_Other "=") (query_file)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [1750]
                )
              ]
            )
            (C {(expect_log)} {(DQ ("//peach:brighton"))})
            (C {(expect_log)} {(DQ ("//peach:harken"))})
          ]
          spids: [1708]
        )
      spids: [1702 1707]
    )
    (C {(run_suite)} {(DQ (${ VSub_Name PRODUCT_NAME) (" query tests"))})
  ]
)