Skip to content

Commit

Permalink
Add a test of the case where two classes of the same name are require…
Browse files Browse the repository at this point in the history
…d in a module

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180599931
  • Loading branch information
tbreisacher authored and blickly committed Jan 3, 2018
1 parent 23ff6b5 commit ae183e1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/com/google/javascript/refactoring/ErrorToFixMapperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,29 @@ public void testShortRequireInGoogModule6() {
"alert(new GoogWidget());"));
}

/**
* Here, if the short name weren't provided the suggested fix would use 'Table' for both,
* but since there is a short name provided for each one, it uses those names.
*/
@Test
public void testShortRequireInGoogModule7() {
assertChanges(
LINE_JOINER.join(
"goog.module('m');",
"",
"var CoffeeTable = goog.require('coffee.Table');",
"var KitchenTable = goog.require('kitchen.Table');",
"",
"alert(new coffee.Table(), new kitchen.Table());"),
LINE_JOINER.join(
"goog.module('m');",
"",
"var CoffeeTable = goog.require('coffee.Table');",
"var KitchenTable = goog.require('kitchen.Table');",
"",
"alert(new CoffeeTable(), new KitchenTable());"));
}

@Test
public void testBug65602711a() {
assertChanges(
Expand Down

0 comments on commit ae183e1

Please sign in to comment.