# # # add_file "tests/t_hook_helpers.at" # content [c9c2f8ccab9786f88fd3d7b6ee486377a58be11e] # # patch "ChangeLog" # from [e8439c40fb8d6781275677145e6f0bb491731d4f] # to [6e8c1a2cd272b4068c4e66c7f149ae6733831636] # # patch "testsuite.at" # from [839af0737ee60440ee431429003e48eca95e9288] # to [fa3102ad0e7ece720b941c86e2ab5505784fb931] # ============================================================ --- tests/t_hook_helpers.at c9c2f8ccab9786f88fd3d7b6ee486377a58be11e +++ tests/t_hook_helpers.at c9c2f8ccab9786f88fd3d7b6ee486377a58be11e @@ -0,0 +1,25 @@ +AT_SETUP([test some hook helper functions]) +MTN_SETUP + +AT_DATA(testhooks, [function ignore_file (name) + ok = true + + filename = write_to_temporary_file("foo") + dat = read_contents_of_file(filename, "r") + if dat ~= "foo" then ok = false end + + if globish_match("a*b", "abc") then ok = false end + if not globish_match("a*b", "acb") then ok = false end + if globish_match("a{b", "abc") ~= nil then ok = false end + + if ok then execute ("touch", "outfile") end + + ignore_file = function (name) return true end + return true +end +]) + +AT_CHECK(RAW_MTN --rcfile testhooks ls unknown, [], [ignore], [ignore]) +AT_CHECK(test -f outfile) + +AT_CLEANUP ============================================================ --- ChangeLog e8439c40fb8d6781275677145e6f0bb491731d4f +++ ChangeLog 6e8c1a2cd272b4068c4e66c7f149ae6733831636 @@ -1,5 +1,11 @@ 2006-04-20 Timtohy Brownawell + * tests/t_hook_helpers.at: New file: test some of the helper functions + for the lua hooks. + * testsuite.at: Add it. + +2006-04-20 Timtohy Brownawell + * commands.cc (commit): E() if the old end of a delta is missing. 2006-04-20 Timtohy Brownawell ============================================================ --- testsuite.at 839af0737ee60440ee431429003e48eca95e9288 +++ testsuite.at fa3102ad0e7ece720b941c86e2ab5505784fb931 @@ -880,3 +880,4 @@ m4_include(tests/t_approve.at) m4_include(tests/t_checkout_heads.at) m4_include(tests/t_ls_epochs.at) +m4_include(tests/t_hook_helpers.at)