File: test-entitymap.pl

package info (click to toggle)
linuxdoc-tools 0.9.86-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,312 kB
  • sloc: ansic: 16,247; perl: 3,769; sh: 1,134; makefile: 813; lex: 566; lisp: 309
file content (23 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# $Id: test-entitymap.pl,v 1.1.1.1 2001/05/24 15:57:40 sano Exp $
#

use Text::EntityMap;

@files = split (/\s/, `echo sdata/*`);
foreach $ii (@files) {
    print "---- $ii ----\n";

    $map = Text::EntityMap->load ($ii);
    open (FILE, $ii)
	|| die "opening \`$ii': $!\n";
    while (<FILE>) {
	chop;
	m/(^[^\t]+)\t(.*)/;
	($key, $value) = ($1, $2);

	if ($map->lookup ($key) ne $value) {
	    warn "$ii:$key: expected \`$value'\n";
	}
    }
}