rust-dc / fish-manpage-completions

Straight port of fish-shell's Python manpage completion script to Rust
19 stars 8 forks source link

impl: Tests for deroff.rs #102

Closed charliethomson closed 4 years ago

charliethomson commented 4 years ago

I implemented a test for every (non macro) function. I'm still working on test_deroff, that may be a different PR, haven't decided yet, it just seems like a bigger fish. I noticed a lot of bugs while I was making the tests, so I fixed all of them and the behaviour matches that of the python source. If you guys notice anything that seems wrong definitely let me know.

pickfire commented 4 years ago

I wonder how do you run the test on python?

charliethomson commented 4 years ago

@pickfire I basically just do py -i deroff.py then

d = Deroffer()
# set the conditions on d im testing
d.whatever_function_im_testing()
d.s
> expected s
d.output
> expected output
scooter-dangle commented 4 years ago

Note: Converted to draft since it looks like there are still some skeleton test functions.

charliethomson commented 4 years ago

@scooter-dangle I'm gonna make a separate PR for test_deroff and test_deroff_files, so unless there's anything you'd like me to fix I think this one is ready

pickfire commented 4 years ago

@charliethomson You have idea how to do test deroff files? By the way, do you do any coverage for what we tested? Or should we do it? But the downside of us testing individual functions is that we won't know if some functions are unreachable based on the context.

charliethomson commented 4 years ago

@pickfire it's in progress right now (its really ugly), but if you want to see what I'm working on right now: branch:test_deroff#1465. It has ~400 errors out of the ~3k test files. About 90 of them deroff but either get something right where the python didn't or fail after the .SH NAME section. I was debugging yesterday, but that branch should be pushed all the way up

charliethomson commented 4 years ago

@scooter-dangle @pickfire does anything need done here

pickfire commented 4 years ago

@charliethomson Good, nice that you found some bugs by writing some tests.