| 1 |
#!/usr/bin/env perl |
| 2 |
# ============================================================================= |
| 3 |
# |
| 4 |
# This file is part of BibTool. |
| 5 |
# It is distributed under the GNU General Public License. |
| 6 |
# See the file COPYING for details. |
| 7 |
# |
| 8 |
# (c) 2011-2020 Gerd Neugebauer |
| 9 |
# |
| 10 |
# Net: [email protected] |
| 11 |
# |
| 12 |
# This program is free software; you can redistribute it and/or modify |
| 13 |
# it under the terms of the GNU General Public License as published by |
| 14 |
# the Free Software Foundation; either version 2, or (at your option) |
| 15 |
# any later version. |
| 16 |
# |
| 17 |
# This program is distributed in the hope that it will be useful, |
| 18 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
# GNU General Public License for more details. |
| 21 |
# |
| 22 |
# You should have received a copy of the GNU General Public License |
| 23 |
# along with this program; if not, write to the Free Software |
| 24 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 25 |
# |
| 26 |
#*============================================================================= |
| 27 |
|
| 28 |
=head1 NAME |
| 29 |
|
| 30 |
count_used.t - Test suite for BibTool count.used. |
| 31 |
|
| 32 |
=head1 SYNOPSIS |
| 33 |
|
| 34 |
count_used.t |
| 35 |
|
| 36 |
=head1 DESCRIPTION |
| 37 |
|
| 38 |
This module contains some test cases. Running this module as program |
| 39 |
will run all test cases and print a summary for each. Optionally files |
| 40 |
*.out and *.err are left if the expected result does not match the |
| 41 |
actual result. |
| 42 |
|
| 43 |
=head1 OPTIONS |
| 44 |
|
| 45 |
none |
| 46 |
|
| 47 |
=head1 AUTHOR |
| 48 |
|
| 49 |
Gerd Neugebauer |
| 50 |
|
| 51 |
=cut |
| 52 |
|
| 53 |
use strict; |
| 54 |
use BUnit;use warnings; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
#------------------------------------------------------------------------------ |
| 59 |
BUnit::run(name => 'count_used_1', |
| 60 |
args => '-- count.used=on bib/x1', |
| 61 |
expected_err => "\n--- Manual 1 read 1 written\n"); |
| 62 |
|
| 63 |
#------------------------------------------------------------------------------ |
| 64 |
BUnit::run(name => 'count_used_2', |
| 65 |
args => '-- count.used=off bib/x1', |
| 66 |
expected_err => ''); |
| 67 |
|
| 68 |
#------------------------------------------------------------------------------ |
| 69 |
BUnit::run(name => '_at_1', |
| 70 |
args => '-@ bib/x1', |
| 71 |
expected_err => "\n--- Manual 1 read 1 written\n"); |
| 72 |
|
| 73 |
#------------------------------------------------------------------------------ |
| 74 |
BUnit::run(name => '_at_2', |
| 75 |
args => '-@ bib/xampl', |
| 76 |
expected_err => <<__EOF__); |
| 77 |
|
| 78 |
*** BibTool WARNING (line 29 in ./bib/xampl.bib): 125 non-space characters ignored. |
| 79 |
|
| 80 |
--- STRING 3 read 3 written |
| 81 |
--- PREAMBLE 1 read 1 written |
| 82 |
--- Article 4 read 4 written |
| 83 |
--- Book 5 read 5 written |
| 84 |
--- Booklet 2 read 2 written |
| 85 |
--- InBook 3 read 3 written |
| 86 |
--- InCollection 3 read 3 written |
| 87 |
--- InProceedings 3 read 3 written |
| 88 |
--- Manual 2 read 2 written |
| 89 |
--- MastersThesis 2 read 2 written |
| 90 |
--- Misc 3 read 3 written |
| 91 |
--- PhDThesis 2 read 2 written |
| 92 |
--- Proceedings 3 read 3 written |
| 93 |
--- TechReport 2 read 2 written |
| 94 |
--- Unpublished 2 read 2 written |
| 95 |
__EOF__ |
| 96 |
|
| 97 |
1; |
| 98 |
#------------------------------------------------------------------------------ |
| 99 |
# Local Variables: |
| 100 |
# mode: perl |
| 101 |
# End: |