Writing more Reftests

Read first

Your second and third test

Once you have successfully written you first Reftest, you can try these additional tests..

  1. Create a file named spaces1.html with the following content:
<html>
  <head>
    <title>spaces1</title>
  </head>
  <body>X X</body>
</html>
  1. Create a file named spaces2.html with the following content:
<html>
  <head>
    <title>spaces2</title>
  </head>
  <body>&nbsp;</body>
</html>
  1. Create a file named spaces3.html with the following content:
<html>
  <head>
    <title>spaces1</title>
  </head>
  <body>X&nbsp;&nbsp;X</body>
</html>
  1. Create a file named spaces4.html with the following content:
<html>
  <head>
    <title>spaces2</title>
  </head>
  <body>X  X</body>
</html>
  1. Create or modify your manifest file named reftest.list with the following content:
== spaces1.html spaces2.html
!= spaces3.html spaces4.html

The first two files, spaces1.html and spaces2.html, are confirming only that a space (the character equal to 0x20 in ASCII) creates the same visual construct as the HTML entity for a non-breaking space. The second pair of files, spaces3.html and spaces4.html, confirms that two regular spaces do not produce the same visual construct as two non-breaking spaces.

When we run these tests (using the using the appropriate section in How to run Reftests) we should see something like the following in our output:

REFTEST TEST-START | file:///.../spaces1.html | 0 / 2 (0%)
REFTEST TEST-START | file:///.../spaces2.html | 0 / 2 (0%)
REFTEST TEST-PASS | file:///.../spaces1.html | image comparison (==)
REFTEST TEST-START | file:///.../spaces3.html | 1 / 2 (50%)
REFTEST TEST-START | file:///.../spaces4.html | 1 / 2 (50%)
REFTEST TEST-PASS | file:///.../spaces3.html | image comparison (!=)

Continue reading