Skip to content

Commit 3283956

Browse files
Add Windows-only test for libedax initialization with non-ASCII book file paths (#902)
* Initial plan * Add Windows-only test for non-ASCII book file path initialization Co-authored-by: sensuikan1973 <23427957+sensuikan1973@users.noreply.github.com> * dart fix . --apply * Use Windows ACP (systemEncoding) instead of UTF-8 when building char* for libedax args. Keeps edax-reversi C code unchanged while fixing non-ASCII path handling on Windows. * mild fix * mild fix * debug * remove Windows-specific handling in toCharPointer method * tmp * update --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sensuikan1973 <23427957+sensuikan1973@users.noreply.github.com> Co-authored-by: sensuikan1973 <sensuikan1973@gmail.com>
1 parent 2f69fac commit 3283956

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/dart_ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: install dependencies
7070
run: dart pub get
7171
- name: test
72-
run: dart run test . --coverage=coverage --concurrency 1
72+
run: dart run test . --coverage=coverage --concurrency 1 --verbose-trace
7373
- name: coverage
7474
run: dart run coverage:format_coverage --lcov --in coverage --out lcov.info
7575
- uses: codecov/codecov-action@v5

.libedax-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9ee809e0f95eb28b9d489869021db919e739b67f
1+
d44438a0b1f0d17229006a49e9e2f592c4f7f413

test/edax_command_test.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,25 @@ void main() {
456456
});
457457
});
458458

459+
group('char code', () {
460+
test('initialize with non-ASCII book file path', () {
461+
final tempDir = Directory.systemTemp.createTempSync('非ASCII_');
462+
try {
463+
final nonAsciiBookFile = '${tempDir.path}/本.dat';
464+
File(_testBookFile).copySync(nonAsciiBookFile);
465+
final edax = LibEdax()
466+
..libedaxInitialize(['', '-book-file', nonAsciiBookFile]);
467+
sleep(const Duration(seconds: 1));
468+
edax.edaxInit();
469+
final moveList = edax.edaxGetBookMove();
470+
expect(moveList.isNotEmpty, true);
471+
edax.libedaxTerminate();
472+
} finally {
473+
tempDir.deleteSync(recursive: true);
474+
}
475+
});
476+
});
477+
459478
group('util command', () {
460479
test('popCount', () {
461480
final edax = LibEdax();

0 commit comments

Comments
 (0)