# # # patch "tests/policy-subpolicies/__driver__.lua" # from [6ae43283d064462ce4b6af746f4774d37e394fcc] # to [3bbc3c470bdc0575e0304aba59deebb94d10d720] # ============================================================ --- tests/policy-subpolicies/__driver__.lua 6ae43283d064462ce4b6af746f4774d37e394fcc +++ tests/policy-subpolicies/__driver__.lua 3bbc3c470bdc0575e0304aba59deebb94d10d720 @@ -11,3 +11,32 @@ check(exists("checkout/delegations/subsu check(mtn("checkout", "checkout", "--branch=test_project.subproject.__policy__"), 0) check(exists("checkout/delegations/subsub")) + +policies = "test_project\n" +policies = policies .. "test_project.subproject\n" +policies = policies .. "test_project.subproject.subsub\n" +check(mtn("ls", "policies", "-R"), 0, policies) + +check(mtn("create_branch", "test_project.firstbranch"), 0, false, true) +check(qgrep("Parent policy: test_project$", "stderr")) + +check(mtn("create_branch", "test_project.subproject.secondbranch"), 0, false, true) +check(qgrep("Parent policy: test_project.subproject$", "stderr")) + +check(mtn("create_branch", "test_project.subproject.subsub.thirdbranch"), 0, false, true) +check(qgrep("Parent policy: test_project.subproject.subsub$", "stderr")) + +check(mtn("ls", "branches"), 0, true) + +check(qgrep("test_project.firstbranch", "stdout")) +check(qgrep("test_project.subproject.secondbranch", "stdout")) +check(qgrep("test_project.subproject.subsub.thirdbranch", "stdout")) + +branchname = "test_project.subproject.secondbranch" +check(mtn("heads", "-b", branchname), 0, false, true) +check(qgrep("is empty", "stderr")) + +check(mtn("setup", "secondbranch", "-b", branchname)) +check(writefile("secondbranch/testfile", "file contents\n")) +check(indir("secondbranch", mtn("add", "testfile")), 0, false, false) +check(indir("secondbranch", mtn("commit", "-mx")), 0, false, false)