Skip to content
This repository was archived by the owner on Feb 8, 2020. It is now read-only.

Commit 7db3f51

Browse files
fix(): Add a test to ensure that numbers are supported
I also reformatted a few lines in the test suite to match the project formatting standard. TAG: latest fixes #120
1 parent 6e3edbe commit 7db3f51

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const actuals = {
3333
'function (a = (true, null)) {}',
3434
'function (a = (true, "bar")) {}',
3535
'function (a, b = (i++, true)) {}',
36+
'function (a = 1) {}',
3637
],
3738
named: [
3839
'function namedFn (a = {foo: "ba)r", baz: 123}, cb, ...restArgs) {return a * 3}',
@@ -44,6 +45,7 @@ const actuals = {
4445
'function namedFn(a = (true, null)) {}',
4546
'function namedFn(a = (true, "bar")) {}',
4647
'function namedFn(a, b = (i++, true)) {}',
48+
'function namedFn(a = 1) {}',
4749
],
4850
generators: [
4951
'function * namedFn (a = {foo: "ba)r", baz: 123}, cb, ...restArgs) {return a * 3}',
@@ -55,6 +57,7 @@ const actuals = {
5557
'function * namedFn(a = (true, null)) {}',
5658
'function * namedFn(a = (true, "bar")) {}',
5759
'function * namedFn(a, b = (i++, true)) {}',
60+
'function * namedFn(a = 1) {}',
5861
],
5962
arrows: [
6063
'(a = {foo: "ba)r", baz: 123}, cb, ...restArgs) => {return a * 3}',
@@ -66,6 +69,7 @@ const actuals = {
6669
'(a = (true, null)) => {}',
6770
'(a = (true, "bar")) => {}',
6871
'(a, b = (i++, true)) => {}',
72+
'(a = 1) => {}',
6973
'(a) => a * 3 * a',
7074
'd => d * 355 * d',
7175
'e => {return e + 5235 / e}',
@@ -130,28 +134,35 @@ const regulars = [
130134
params: 'a',
131135
args: ['a'],
132136
body: '',
133-
defaults: {a: 'false'},
137+
defaults: { a: 'false' },
134138
},
135139
{
136140
name: null,
137141
params: 'a',
138142
args: ['a'],
139143
body: '',
140-
defaults: {a: 'null'},
144+
defaults: { a: 'null' },
141145
},
142146
{
143147
name: null,
144148
params: 'a',
145149
args: ['a'],
146150
body: '',
147-
defaults: {a: '"bar"'},
151+
defaults: { a: '"bar"' },
148152
},
149153
{
150154
name: null,
151155
params: 'a, b',
152156
args: ['a', 'b'],
153157
body: '',
154-
defaults: {a: undefined, b: 'true'},
158+
defaults: { a: undefined, b: 'true' },
159+
},
160+
{
161+
name: null,
162+
params: 'a',
163+
args: ['a'],
164+
body: '',
165+
defaults: { a: '1' },
155166
},
156167
]
157168

0 commit comments

Comments
 (0)