Skip to content

Commit

Permalink
fix an issue with escaped test names (flutter#3082)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew authored Jan 15, 2019
1 parent 7207674 commit ed77139
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public Info getInfo(@NotNull PsiElement element) {

@NotNull
private static Icon getTestStateIcon(@NotNull PsiElement element, @NotNull Icon defaultIcon) {

// SMTTestProxy maps test run data to a URI derived from a location hint produced by `package:test`.
// If we can find corresponding data, we can provide state-aware icons. If not, we default to
// a standard Run state.
Expand Down
6 changes: 5 additions & 1 deletion src/io/flutter/run/test/TestConfigUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.jetbrains.lang.dart.psi.DartCallExpression;
import com.jetbrains.lang.dart.psi.DartFile;
import com.jetbrains.lang.dart.psi.DartStringLiteralExpression;
import groovy.json.StringEscapeUtils;
import io.flutter.FlutterUtils;
import io.flutter.dart.DartSyntax;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -89,7 +90,10 @@ public static String findTestName(@Nullable PsiElement elt) {
final DartStringLiteralExpression lit = DartSyntax.getArgument(call, 0, DartStringLiteralExpression.class);
if (lit == null) return null;

return DartSyntax.unquote(lit);
final String name = DartSyntax.unquote(lit);
if (name == null) return null;

return StringEscapeUtils.unescapeJava(name);
}

enum TestType {
Expand Down

0 comments on commit ed77139

Please sign in to comment.