Skip to content

Commit 7b89a39

Browse files
author
Japnit
committed
Added test cases for fix
1 parent 701db81 commit 7b89a39

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/operations/functions/dropFunction.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@ describe('operations', () => {
2929
'DROP FUNCTION IF EXISTS "sqrt"(integer) CASCADE;'
3030
);
3131
});
32+
33+
it('should ignore default values in function parameters when dropping function', () => {
34+
const params = [
35+
{
36+
name: 'x',
37+
type: 'integer',
38+
default: 10,
39+
},
40+
];
41+
42+
const statement = dropFunctionFn('func_with_default', params);
43+
44+
expect(statement).toBeTypeOf('string');
45+
expect(statement).toBe(
46+
'DROP FUNCTION "func_with_default"("x" integer);'
47+
);
48+
});
3249
});
3350
});
3451
});

0 commit comments

Comments
 (0)