Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to the repo #75

Open
suve opened this issue Sep 14, 2020 · 4 comments
Open

Add tests to the repo #75

suve opened this issue Sep 14, 2020 · 4 comments

Comments

@suve
Copy link
Contributor

suve commented Sep 14, 2020

Looking at .gitignore, there's this line:

/testcases/*

which hints that some tests have been written for the program, but are excluded from the repository.

It would be useful to have these tests as part of the repo.

  1. It would make contributing easier, as it'd provide a way to check against regressions.
  2. It would allow third-party redistributors (e.g. Linux distro packagers) to verify that the program runs as intended.
@theZiz
Copy link
Owner

theZiz commented Sep 17, 2020

eagle eye! 😉

But I did not write any test automation. I will put them into an own branch for now and we will see whether it helps or whether someone wants to use them for something more useful. 😁

https://github.com/theZiz/aha/tree/testcases

@theZiz theZiz closed this as completed Sep 17, 2020
@suve
Copy link
Contributor Author

suve commented Sep 18, 2020

I took a brief look at the testcases branch. The setup is a bit similar to something I've done before, so here's my suggestion:

  • put each test into it's own separate directory
  • use the same name for the "input" and "expected output" file in each test

It is then trivial to write a Makefile that treats each directory name as a target name, so when you run make some-test it runs the program as needed and compares output. I can take care of this part, if you'd like.

@theZiz
Copy link
Owner

theZiz commented Sep 18, 2020

The problem I see, is, that the html can change but the result still be valid. But I guess you can easily adjust the testcases if need. 🤷

So, I myself will not find the spare time for this. If you want to contribute this, feel free! 😃

@theZiz theZiz reopened this Sep 18, 2020
@namazso
Copy link

namazso commented Feb 19, 2022

I'd suggest making the tests run on an intermediate representation consisting of the characters and the state of each. This would help test the part more likely to break (the parser) and avoid changes that only affect the state to html conversion. Additionally a separate set of tests could be added for testing state to html translation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants