Commit 61f0a17
authored
feat(annotations): complete DSL surface — composite tests, See selectors, P0 bugfixes (v0.9.6) (#109)
Closes every gap identified in the v0.9.5 audit of flutter_probe_annotation
and flutter_probe_gen. Goes from ~70% coverage of the ProbeScript surface
to full parity, with comprehensive golden tests cross-validated against
the Go parser.
P0 correctness bugs (would silently break user tests at runtime):
* Mock path is now quoted in the emitted 'when the app calls ...' line.
Was unquoted, so the Go lexer split on '/' and the parser only kept
the first IDENT segment — Mock(path: '/api/products') silently became
/api. Now emits 'when the app calls GET "/api/products"' and the
full path round-trips.
* See suffixes (state + containing + matching) now compose additively
instead of overwriting. See('x', state: SeeState.enabled, containing:
'y') used to silently drop the state; now emits both.
P1 missing feature:
* @ProbeCompositeTest DSL — Device, OnDevice, Sync classes. Emitter
walks devices then body, rendering <alias>: groups and sync "label"
barriers. Round-trips through the Go parser's full composite test
machinery (parser.go:1433+).
P1 incoherent surface:
* Press and Pinch are now @deprecated — the Go parser has no case for
them, emitted text fell through to parseRecipeCall. Use GoBack() in
place of Press('back').
P2 under-modeled assertions:
* See.id(key) / See.selector(Selector) factories — assertions can now
target by ValueKey or any rich selector (Ordinal, Below/Above/
LeftOf/RightOf, InContainer, TypeSel). Same on DontSee. The Go
parser always supported this; the DSL just didn't expose it.
* WaitUntil.idAppears(key) / .idDisappears(key) — emits unquoted #key
so the Go parser's WaitSelector branch (parser.go:846) matches.
P3 robustness:
* Emitter no longer indexes hard-coded arrays by enum.index. Reads
the enum constant identifier via _name. Reordering Direction,
HttpMethod, or SeeState no longer silently corrupts output.
Comprehensive tests (the user's strictness ask):
* 6 new golden fixture pairs in probe_gen/test/fixtures/:
- mock_and_call (catches P0 #1 regression)
- see_states (catches P0 #2 regression + new selector forms)
- composite_chat (exercises every composite construct)
- wait_variants (every wait kind + id-based)
- examples_inline (data-driven Examples)
- kitchen_sink (one of every step + selector + control flow)
* Builder tests: 5 → 11 (one per golden + existing 5).
* Cross-language goldens: 4 → 10. Every Dart-emitted .probe round-
trips through internal/parser/parser.go via golden_integration_test.
Docs:
* New website page: website/src/content/docs/probescript/annotations.md
— full reference for the DSL with every step class, selector kind,
and composite syntax. Added to Starlight sidebar.
* docs/wiki/Annotations.md version refs bumped.
* README.md highlights composite tests in the annotation section.
* Per-package CHANGELOGs detail the changes.
Versions bumped to 0.9.6:
probe_agent, probe_annotation, probe_gen pubspec.yaml + CHANGELOG.md
vscode/package.json
docs/wiki/Home.md
website/src/content/docs/tools/mcp.md verify snippet
probe_gen depends on flutter_probe_annotation: ^0.9.6
Verification (all green before commit):
go test ./... 16/16 packages pass
staticcheck ./... zero issues
dart analyze (annot) no issues found
dart test (annot) 3/3 const tests pass
dart analyze (gen) no issues found
dart test (gen) 11/11 builder tests pass (5 existing + 6 new)
go test ...GoldenIntegration 10/10 Dart goldens parse cleanly
dart pub publish --dry-run both packages 0 errors
Astro build 37 pages generated successfully1 parent 625226d commit 61f0a17
32 files changed
Lines changed: 1040 additions & 59 deletions
File tree
- docs/wiki
- internal/parser
- probe_agent
- probe_annotation
- lib/src
- probe_gen
- lib/src
- test
- fixtures
- vscode
- website
- src/content/docs
- probescript
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
9 | 28 | | |
10 | 29 | | |
11 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
| 379 | + | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
3 | 34 | | |
4 | 35 | | |
5 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
0 commit comments