#!/bin/sh

echo -n $0: 'HTML URLs wordlist... '

cat >test.html <<eof
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Page title</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta charset="ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
Page content
<a href="url1">URL1</a>
<a href="url2">URL2</a>
<a href="url1">URL1</a>
</body>
</html>
eof

cat >test.ref <<eof
Page
title
Page
content
URL
URL
URL
eof

sh ./test/run -w test.html >test.data

if cmp test.ref test.data
then
  rm -f test.*
  echo passed
else
  echo failed
  exit 1
fi
