Skip to content

Commit 9d299fe

Browse files
graycreateclaude
andcommitted
fix: resolve CI pipeline issues
- Fix unit test failures in ExampleUnitTest and TestParse - Update CI workflow to use x86_64 architecture for Android emulators - Fix matcher.group() call without find() check - Fix whitespace assertion in time parsing test 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3cdfdc0 commit 9d299fe

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ jobs:
186186
uses: reactivecircus/android-emulator-runner@v2
187187
with:
188188
api-level: ${{ matrix.api-level }}
189+
arch: x86_64
189190
force-avd-creation: false
190191
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
191192
disable-animations: false
@@ -195,6 +196,7 @@ jobs:
195196
uses: reactivecircus/android-emulator-runner@v2
196197
with:
197198
api-level: ${{ matrix.api-level }}
199+
arch: x86_64
198200
force-avd-creation: false
199201
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
200202
disable-animations: true

app/src/test/java/me/ghui/v2er/ExampleUnitTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ public void testFindDigital() {
2323
String text = "你有100元红包";
2424
Pattern pattern = Pattern.compile("\\d[\\d.,]*(?=元)");
2525
Matcher matcher = pattern.matcher(text);
26-
String result = matcher.group();
27-
assertEquals("100", result);
26+
if (matcher.find()) {
27+
String result = matcher.group();
28+
assertEquals("100", result);
29+
} else {
30+
throw new AssertionError("Pattern not found in text");
31+
}
2832
}
2933
}

app/src/test/java/me/ghui/v2er/TestParse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void testSplitTime() {
1717
if (!Check.isEmpty(time)) {
1818
time = time.trim().split("•")[1].trim();
1919
}
20-
assert time.equals("36 天前 ");
20+
assert time.equals("36 天前");
2121
System.out.println(System.currentTimeMillis());
2222
}
2323
}

0 commit comments

Comments
 (0)