NAME
Emacs::Run::Testorama - routines for just for writing tests of Emacs::Run
SYNOPSIS
use Emacs::Run::Testorama ':all';
my $mock_home = "$Bin/dat/home/mockingbird";
my $code_lib = "$USR/lib";
my $code_lib_alt = "$USR/lib-alt";
my $dot_emacs_tpl = "$SRC_LOC/templates/.emacs-template";
create_dot_emacs_in_mock_home( $mock_home, $code_lib, $code_lib_alt, $dot_emacs_tpl );
DESCRIPTION
Emacs::Run::Testorama is a small collection of utility routines to be used in testing the Emacs::Run package. It is not expected that there will be any reason to install this for use on the system at large.
EXPORT
None by default. The follow are available on request (all can be requested at once using the ':all" tag).
- clean_whitespace
-
# trims leading and trailing whitespace on multi-line text. # eliminates blank lines. # this is used to make it eaisier to compare generated and expected elisp
- create_dot_emacs_in_mock_home
-
# create a .emacs for $mock_home
Args:
first: (path) a mock home location for a non-existant user second: (path) a dummy location of elisp libraries third: (path) another dummy location of elisp libraries fourth: (file) the dot emacs "template" used to create a .emacs for the dummy user
Note: this resorts to a number of cheesy expedients that would not be recommended in production use: The .emacs files are generated using a home grown template "language" where the second and third arguments of this routine are subsituted for the strings 'XXX' and 'YYY'. For our current purposes, we expect that these are elisp library locations, but nothing enforces this.
- echo_home
-
Prints the current home location to STDERR (for debugging purposes).
- slurp_files
-
Given two files (with full paths, most likely) open them, slurp in their contents, and return a list of both of them.
This is a utility to make it slightly easier to compare the effects of a file munging operation to an archived copy of the expected results.
Example usage:
my ($result, $expected) = slurp_files($result_file, $expected_file); eq_or_diff( $result, $expected, "$test_name: checking effects of upcase-region on $result_file"); # Note: presumes Test::Differences is in use.
- get_short_label_from_name
-
If a given name is long (i.e. has many hyphens), will create a short version of it (arbitrarily taking the fourth element).
SEE ALSO
AUTHOR
Joseph Brenner, <doom@kzsu.stanford.edu>
COPYRIGHT AND LICENSE
Copyright (C) 2008 by Joseph Brenner
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.
BUGS
None reported... yet.