Files
openchamber-android-native/test/paths_test.dart
T
blumia 6ced914757 fix: centre the context ring, show a live status while running, and settle project rows
- The folded composer aligns to its bottom edge, so the 16px usage ring sat
  below the 36px keys; a 10px bottom padding puts it on their centre line (the
  two-row layout was already centred).
- A running turn no longer shows the finished turn's footer (model · mode ·
  time, with its copy/fork menu). Above the input there is now an activity
  strip like dsh-Go's: "思考中 / 正在回复 / 正在读取 · …" with the current
  step's summary and a clock that ticks each second.
- Project headers in the sidebar are tinted bands at least a session row tall,
  with a folder icon, a bolder name and the path beneath, so the project and
  its sessions read as different levels.
- Project names take the last path segment with either separator, and path
  comparisons unify `\`/`/` (case-insensitively for drive-letter paths); the
  grouping key does too, so a Windows server no longer shows a full path or
  splits one project in two.
- 0.3.19 (319).
2026-11-22 11:59:33 +08:00

34 lines
1.1 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:openchamber/api/models.dart';
void main() {
test('a Windows project path reads as its folder name', () {
expect(pathLeaf(r'C:\msys64\home\Gary\Sources\pineapple-notepad'),
'pineapple-notepad');
expect(pathLeaf('/home/blumia/Sources/telegram/'), 'telegram');
expect(pathLeaf('relative'), 'relative');
expect(
ProjectInfo(id: 'p', canonical: r'C:\work\pineapple-notepad').label,
'pineapple-notepad',
);
expect(
ProjectInfo(id: 'p', canonical: '/w/x', name: '显式名称').label,
'显式名称',
);
});
test('the same place compares across separators and Windows case', () {
expect(samePath(r'C:\x\y', 'C:/x/y'), isTrue);
expect(samePath(r'C:\X\y', r'c:\x\Y'), isTrue);
expect(samePath('/a/b/', '/a/b'), isTrue);
expect(samePath('/a/b', '/a/c'), isFalse);
// A POSIX path stays case-sensitive.
expect(samePath('/a/B', '/a/b'), isFalse);
});
test('slashPath only unifies separators', () {
expect(slashPath(r'C:\a\b\'), 'C:/a/b');
});
}