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

Fix errors for overloaded function arguments #1496

Merged
merged 3 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/core_functions/color/hsl/error/five_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ five-arg {
}

<===> error
Error: Only 1 argument allowed, but 5 were passed.
Error: Only 4 arguments allowed, but 5 were passed.
,
2 | x: hsl(0, 100%, 50%, 0.5, 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 12 additions & 0 deletions spec/core_functions/color/hsl/error/zero_args.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<===> input.scss
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

zero-args {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the tests around this predate the style guide, these new tests should follow it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I know it's frowned upon to impose new style on old code, but I saw enough low-hanging fruit to justify cleaning up the surrounding tests too.

x: hsl();
}

<===> error
Error: Missing argument $channels.
,
2 | x: hsl();
| ^^^^^
'
input.scss 2:6 root stylesheet
2 changes: 1 addition & 1 deletion spec/core_functions/color/hsla/error/five_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ five-arg {
}

<===> error
Error: Only 1 argument allowed, but 5 were passed.
Error: Only 4 arguments allowed, but 5 were passed.
,
2 | x: hsla(0, 100%, 50%, 0.5, 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 12 additions & 0 deletions spec/core_functions/color/hsla/error/zero_args.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<===> input.scss
zero-args {
x: hsla();
}

<===> error
Error: Missing argument $channels.
,
2 | x: hsla();
| ^^^^^^
'
input.scss 2:6 root stylesheet
2 changes: 1 addition & 1 deletion spec/core_functions/color/rgb/error/five_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ five-args {
}

<===> error
Error: Only 1 argument allowed, but 5 were passed.
Error: Only 4 arguments allowed, but 5 were passed.
,
2 | x: rgb(1, 2, 3, 0.4, 5);
| ^^^^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 12 additions & 0 deletions spec/core_functions/color/rgb/error/zero_args.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<===> input.scss
zero-args {
x: rgb();
}

<===> error
Error: Missing argument $channels.
,
2 | x: rgb();
| ^^^^^
'
input.scss 2:6 root stylesheet
2 changes: 1 addition & 1 deletion spec/core_functions/color/rgba/error/five_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ five-args {
}

<===> error
Error: Only 1 argument allowed, but 5 were passed.
Error: Only 4 arguments allowed, but 5 were passed.
,
2 | x: rgba(1, 2, 3, 0.4, 5);
| ^^^^^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 12 additions & 0 deletions spec/core_functions/color/rgba/error/zero_args.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<===> input.scss
zero-args {
x: rgba();
}

<===> error
Error: Missing argument $channels.
,
2 | x: rgba();
| ^^^^^^
'
input.scss 2:6 root stylesheet
2 changes: 1 addition & 1 deletion spec/core_functions/color/saturate.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ a {
a {b: saturate()}

<===> error/too_few_args/error
Error: Missing argument $color.
Error: Missing argument $amount.
,
1 | a {b: saturate()}
| ^^^^^^^^^^
Expand Down