Skip to content

ircdocs/parser-tests

Folders and files

NameName
Last commit message
Last commit date
May 4, 2020
May 4, 2020
May 29, 2023
Jun 22, 2015
Jun 23, 2015
Jan 4, 2019
May 4, 2020
Jan 4, 2019
Jan 4, 2019
Nov 28, 2016
Nov 28, 2016

Repository files navigation

IRC Parser Tests

Various tests for IRC parsers so people can check to ensure they're consistent. These tests are based on existing test suites and widespread client behaviour.

Note: This is still being written. Feel free to suggest or contribute tests - PRs are welcomed!

Testing

There are two included tests used to test these vectors, the Python and Golang programs.

Using the python library

Either pip install irc_parser_tests or add irc_parser_tests to your requirements.txt. The test data is available in the module parser_tests.

Releasing a new python version

  1. Bump the version identifier in parser_tests/__init__.py
  2. Commit the version bump and tag it git tag v<version>
  3. Push to master
  4. Github actions will deploy to PyPi

Python

The test.py script uses the girc and ircmatch libraries as reference implementations, as well as pyyaml to parse the test files.

To install these libraries, run:

pip3 install --upgrade girc ircmatch pyyaml

After that, simply run the script with python3 test.py in the root dir. This will test everything we can test, and show the output.

Go

The test.go script uses the girc-go packages as reference implementations.

To install these packages, run:

go get -u ./...

After that, simply run the script with go run test.go run in the root dir. This will test everything we can test, and show the output.

Sources

Thanks to these sources for having open tests and/or agreeing to let me include your tests here!

Some tests originate from Mozilla's test vectors, which are public domain.

Some tests originate from grawity's test vectors which were WTFPL v2 licensed when they were retrieved.

Some tests originate from Sadie's test vectors which she's indicated I'm free to include here.