-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature used parameter expectation #266
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
hasUnusedParameters (js "function x(m2, m2) { g(m1); return m2 } ") `shouldBe` False | ||
|
||
it "is False when uses all its parameters in return" $ do | ||
hasUnusedParameters (js "function x(m2, m2) { return m1 + m2 } ") `shouldBe` False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe parameters in these two tests should be x(m1, m2)
describe "hasUnusedParameters" $ do | ||
it "is False for methods of all kinds" $ do | ||
hasUnusedParameters (js "var o = {x: function(m) { return 4; }}") `shouldBe` False | ||
hasUnusedParameters (js "var o = {x: function(m) { return m; }}") `shouldBe` False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense!
This is a work in progress since I want to add this check as an inspection instead of an smell, due to backward compatibility issues.