Skip to content
New issue

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

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

Already on GitHub? # to your account

Docstring testing in SP files #3

Open
theY4Kman opened this issue Jul 12, 2016 · 1 comment
Open

Docstring testing in SP files #3

theY4Kman opened this issue Jul 12, 2016 · 1 comment

Comments

@theY4Kman
Copy link
Owner

theY4Kman commented Jul 12, 2016

It would be neat to write a pytest plug-in which automatically extracts tests written alongside actual SourcePawn code. This would be a very viable option for plug-in authors to begin testing. Perhaps something like this:

// STYLE A
/// @assert Negate(False)
/// @assert not Negate(True)
public Negate(thing) {
    return !thing;
}


// STYLE B -- more py.test/go test like: 
#ifdef TEST
public bool:TestMyStuff() {
    return MyStuff() == 12;
}
#endif
@jaredballou
Copy link

I was just talking to Psytronic about this. I'd really like to see better documentation and test functionality in SourceMod, my guess is we'd want to coordinate with the main project on the format and syntax of this.

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

No branches or pull requests

2 participants