Skip to content

Commit

Permalink
Add a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger authored and foolip committed Sep 3, 2019
1 parent 2614e33 commit dcf0cdb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions resources/test/tests/unit/IdlInterface/constructors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<title>IdlInterface.prototype.constructors()</title>
<div id="log"></div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script src="../../../idl-helper.js"></script>
<script>
"use strict";
test(function() {
var i = interfaceFrom('[Constructor] interface A { };');
assert_equals(i.constructors().length, 1);
}, 'Interface with Constructor extended attribute.');

test(function() {
var i = interfaceFrom('interface A { constructor(); };');
assert_equals(i.constructors().length, 1);
}, 'Interface with constructor method');

test(function() {
var i = interfaceFrom('[Constructor] interface A { constructor(); };');
assert_equals(i.constructors().length, 2);
}, 'Interface with both');
</script>

0 comments on commit dcf0cdb

Please sign in to comment.