Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ Mohamed El Sayed <devblooming@tutanota.com>
Edwin Ludik <edwin.ludik@gmail.com>
Japnit Singh <truejswalia@gmail.com>
Dmitry Kandalov <dmitry.kandalov@gmail.com>
Kazuya Chikamatsu <kazu.chika.shima@gmail.com>
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Fixed

- Silent failure when opening Flutter projects without `.idea` directory in IntelliJ IDEA, by removing `FlutterProjectOpenProcessor` and migrating configuration logic to `FlutterInitializer`. (#8845)
- Fixed gutter buttons not running tests with non-ASCII characters in their names. (#7985)
Comment thread
chika3742 marked this conversation as resolved.
Outdated

## 90.0.0

Expand Down
11 changes: 7 additions & 4 deletions src/io/flutter/run/common/CommonTestConfigUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,16 @@ public String findTestName(@Nullable PsiElement elt) {
final DartCallExpression call = findEnclosingTestCall(elt, getTestsFromOutline(elt.getContainingFile()));
if (call == null) return null;

return extractTestName(call);
Comment thread
chika3742 marked this conversation as resolved.
}

@VisibleForTesting
@Nullable
public String extractTestName(@NotNull DartCallExpression call) {
final DartStringLiteralExpression lit = DartSyntax.getArgument(call, 0, DartStringLiteralExpression.class);
if (lit == null) return null;

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

return StringUtil.escapeProperty(name, false);
return DartSyntax.unquote(lit);
}
Comment thread
chika3742 marked this conversation as resolved.

/**
Expand Down
33 changes: 33 additions & 0 deletions testSrc/unit/io/flutter/run/common/CommonTestConfigUtilsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2026 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.run.common;

import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.source.tree.LeafPsiElement;
import com.jetbrains.lang.dart.psi.DartCallExpression;
import io.flutter.AbstractDartElementTest;
import io.flutter.dart.DartSyntax;
import io.flutter.run.test.TestConfigUtils;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class CommonTestConfigUtilsTest extends AbstractDartElementTest {
@Test
public void extractTestNameShouldNotEscapeNonAscii() throws Exception {
run(() -> {
final PsiElement testKeyword = setUpDartElement(
"main() { test('テスト', () {}); }", "test", LeafPsiElement.class);
final DartCallExpression call =
DartSyntax.findEnclosingFunctionCall(testKeyword, "test");
assertNotNull(call);

final String name = TestConfigUtils.getInstance().extractTestName(call);
assertEquals("テスト", name);
Comment thread
chika3742 marked this conversation as resolved.
});
}
}