Index: openacs-4/packages/xowiki/tcl/test/api-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/api-test-procs.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/xowiki/tcl/test/api-test-procs.tcl 2 Jul 2019 10:48:43 -0000 1.1.2.3 +++ openacs-4/packages/xowiki/tcl/test/api-test-procs.tcl 2 Nov 2019 15:46:40 -0000 1.1.2.4 @@ -3,39 +3,38 @@ -procs { "::xowiki::Package instproc normalize_path" } \ - package_api_calls { + package_normalize_path { - Checks various API calls on package level + Checks various forms of the xowiki::Package API method + "normalize_path". - @author Gustaf Neumann -} { - - set package_id [acs::test::require_package_instance \ - -package_key xowiki] - ::xowiki::Package initialize -package_id $package_id - - # - # Don't allow addressing outside of the jail - # - foreach pair { - {"view-default" "view-default"} - {"view-default/." "view-default"} - {"./view-default/." "view-default"} - {"../view-default/." "view-default"} - {"../../view-default/." "view-default"} - {"/../../view-default/." "view-default"} - {".." ""} - {"/../../view-default/../" ""} - {"/etc/hosts" "etc/hosts"} - {"//etc/hosts" "etc/hosts"} - {"/../etc/hosts" "etc/hosts"} - {"view-default/../../etc" "etc"} - {"view-default/../../../../../etc" "etc"} } { - lassign $pair path expected - aa_equals "check $path -> $expected" [$package_id normalize_path $path] $expected + set package_id [acs::test::require_package_instance \ + -package_key xowiki] + ::xowiki::Package initialize -package_id $package_id + + # + # Don't allow addressing outside of the jail + # + foreach pair { + {"view-default" "view-default"} + {"view-default/." "view-default"} + {"./view-default/." "view-default"} + {"../view-default/." "view-default"} + {"../../view-default/." "view-default"} + {"/../../view-default/." "view-default"} + {".." ""} + {"/../../view-default/../" ""} + {"/etc/hosts" "etc/hosts"} + {"//etc/hosts" "etc/hosts"} + {"/../etc/hosts" "etc/hosts"} + {"view-default/../../etc" "etc"} + {"view-default/../../../../../etc" "etc"} + } { + lassign $pair path expected + aa_equals "check $path -> $expected" [$package_id normalize_path $path] $expected + } } -} # # Local variables: