NAME

File::System::Test - Module for testing file system drivers

DESCRIPTION

This suite of test subroutines will test if a file system object is internally consistent and can be used to test other features of the object.

The following tests are available:

is_root_sane($obj, $name)

Checks to make sure the root file object is generally sane. It tests the following:

  • Is the root object defined?

  • Does the root subroutine of the root object represent the same path?

  • Is the path '/'?

  • Does stringify work correctly?

  • Does basename return ''?

  • Does dirname return '/'?

  • Does a lookup of '' exist? Does it represent the same path?

  • Does a lookup of '.' exist? Does it represent the same path?

  • Does a lookup of '..' exist? Does it represent the same path?

  • Does a lookup of '/' exist? Does it represent the same path?

  • Does is_root return true?

  • Is parent path the same as root path?

  • Does properties return at least basename, dirname, and path?

  • Does is_container return true?

is_object_sane($obj, $name)

This test performs the following:

  • Is the object defined?

  • Does stringify work?

  • Does lookup of path result in object for same path?

  • Does basename return the basename of path?

  • Does dirname return the dirname of path?

  • Does is_root return false?

  • Does parent path match dirname?

  • Does properties return at least basename, dirname, and path?

is_container_sane($obj, $name)

Runs additional container specific tests. It tests the following:

  • Does is_container return true?

  • Can the container has_children?

  • Can the container children_paths?

  • Can the container children?

  • Can the container child?

  • If not has_children, does children_paths return '.' and '..' only? Does children return an empty list?

  • If the container has_children, does children_paths return '.' and '..' and more? Does children return a non-empty list?

  • If the container has_children, does each child return an object for the same path as lookup.

is_content_sane($obj, $name)

Runs additional content specific tests. It tests the following:

  • Does is_content return true?

is_content_writable($obj, $name)

Checks to see if the given file object is writable and confirms that writing works as expected.

  • Check to see if is_readable and is_writable.

  • Does open("w") work?

  • Can we write to the file handle returned by open("w")?

  • Does the file handle close properly?

  • Is the content of the file the same as written?

  • Check to see if is_appendable. If so, write one more line to the end, close and reopen to check that the file is as expected.

  • Check to see if is_seekable. If so, seek into the middle, overwrite part of the file, close andreopen to check that the file is as expected.

is_container_mobile($obj, $dest, $name)

Checks to see if the container $obj can be renamed (to 'renamed_container' and back), moved to the given container $dest (and moved back), and copied to the given container (and the copy removed).

Checks to make sure that after each of these operations that the entire subtree is preserved.

is_container_mobile($obj, $dest, $name)

Checks to see if the content $obj can be renamed (to 'renamed_content' and back), moved to the given container $dest (and moved back), and copied to the given container (and the copy removed).

is_glob_and_find_consistent($obj, $name)

Checks several different glob patterns on the object to see if the glob patterns find the same set of objects that a similar find operation returns. The object passed can be a root object or any other object in the tree.

This method also tests to see that the various different ways of calling glob and find are self-consistent. That is,

$obj->find(\&test) === $root->find(\&test, $obj)
$obj->glob($test)  === $root->glob("$obj/$test")

SEE ALSO

File::System::Object

AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@users.sourceforge.net>

COPYRIGHT AND LICENSE

Copyright 2005 Andrew Sterling Hanenkamp. All Rights Reserved.

This library is licensed and distributed under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 697:

You forgot a '=back' before '=head1'