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

Confusing syntax: addTest/go #18

Open
DazWilkin opened this issue Mar 7, 2012 · 0 comments
Open

Confusing syntax: addTest/go #18

DazWilkin opened this issue Mar 7, 2012 · 0 comments

Comments

@DazWilkin
Copy link
Contributor

I find this syntax (from the readme) confusing:

var test = TypedJS.addTest('concat :: String -> String -> String', concat);
TypedJS.go([test]);

The "addTest" function name suggests (to me) that TypedJS is maintaining an internal collection of the tests for which I'd expect to be able to call 'go' to run the current tests:

TypedJS.addTest('concat :: String -> String -> String', concat);
TypedJS.go();

Perhaps it would be more appropriate to rename "addTest" to "createTest" and "go" to "runTests"?

var tests = $.map([{
    name: concat,
    type: "concat :: String, String -> Boolean"},
{
    name: add,
    type: "add :: Number, Number -> Number"}], function(func) {
    return TypedJS.createTest(func.type, func.name);
});
TypedJS.runTests(tests);
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

1 participant