Skip to content

Commit

Permalink
Adding ES6 module checks for each warning type in CheckInterfacesTest…
Browse files Browse the repository at this point in the history
… of the LINTCHECKS pass. Part of verification/adding of ES6 module compatibility to compiler.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159856269
  • Loading branch information
hjkaria authored and blickly committed Jun 22, 2017
1 parent c380079 commit e5083c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/com/google/javascript/jscomp/lint/CheckInterfacesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@ public void testInterfaceArgs() throws Exception {
testSame("/** @interface */ function A(x) {}",
CheckInterfaces.INTERFACE_SHOULD_NOT_TAKE_ARGS);

testSame("var ns = {};\n"
+ "/** @interface */\n"
+ "ns.SomeInterface = function(x) {};",
testSame(
LINE_JOINER.join(
"var ns = {};\n", "/** @interface */\n", "ns.SomeInterface = function(x) {};"),
CheckInterfaces.INTERFACE_SHOULD_NOT_TAKE_ARGS);
}

public void testInterfaceNotEmpty() {
testSame("/** @interface */ function A() { this.foo; }",
CheckInterfaces.INTERFACE_FUNCTION_NOT_EMPTY);

testSame("var ns = {};\n"
+ "/** @interface */\n"
+ "ns.SomeInterface = function() { this.foo; };",
testSame(
LINE_JOINER.join(
"var ns = {};\n",
"/** @interface */\n",
"ns.SomeInterface = function() { this.foo; };"),
CheckInterfaces.INTERFACE_FUNCTION_NOT_EMPTY);
}
}

0 comments on commit e5083c5

Please sign in to comment.