Skip to content

test: comprehensive integration test suite#147

Merged
FluxxField merged 10 commits into
devfrom
feat/integration-tests
Mar 9, 2026
Merged

test: comprehensive integration test suite#147
FluxxField merged 10 commits into
devfrom
feat/integration-tests

Conversation

@FluxxField

@FluxxField FluxxField commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Comprehensive integration test suite using mini.test (vendored, no external deps)
  • 445 tests across 40 files, all passing on Neovim 0.10.4, stable, and nightly
  • CI workflow runs make test on push/PR to master and dev

Test Coverage

File Tests Covers
test_config 43 Config validation: defaults, keys, dim_background (+ deprecated name), booleans, numerics, count_behavior, max_pins, highlights, presets, selection_keys
test_exit_events 14 Exit event system: throw, throw_if, wrap, protect, safe
test_actions 8 Action chains: jump, restore, yank, merge composition, yank+restore regression (#140), registered yank_jump
test_actions_extended 20 resolve_range (all modes), set_register, delete, delete_line, yank_line, change, change_line, paste, paste_line, center, registered chains
test_auto_select 6 Auto-select regression (#141), count_select, module loader error handling
test_state 9 State init, create, finalize (label math), reset, merge_motion_state
test_pipeline 18 Lines collector, words extractor, default modifier/filter, direction filters, collector→extractor integration, full pipeline
test_pipeline_integration 9 Full pipeline.run with setup, engine loop single-pass, count_select, multi-window, words extractor coroutine
test_registry 10 Registry CRUD, key/name lookup, register_many, override, default metadata, registries manager
test_highlight 9 dim_background toggle, clear extmarks, single/double hint label placement
test_highlight_setup 4 Default highlight groups, custom colors, string group names, background highlights
test_flow_state 22 Cancel keys, flow lifecycle, expiration, evaluate_flow_at_motion_start
test_targets 10 format_target, get_target_under_cursor (word/line/mid-word), get_targets with coroutine, before_cursor reversal
test_filters 18 All direction filters (before/after/around), cursor_line_only, visible_lines, first_target, filter merge, multi-window bypass
test_composed_filters 9 Composed filter registrations, direction metadata, cursor-line behavioral, merged/non-merged metadata
test_selection_handlers 13 select_first, select_last, toggle_hint_position, toggle_direction, toggle_multi_window, expand_search_scope
test_label_conflict 10 Conflict char detection, key filtering (case insensitive), end of line, non-alphanumeric handling
test_fuzzy 14 FZY match algorithm (exact, substring, no match, case sensitivity, camelCase/word boundaries), find_matches_in_line
test_context 6 context.get() fields, cursor position, mode, windows list
test_utils 10 is_non_empty_string, prepare_motion, module_wrapper (table and coroutine returns)
test_hints 9 Label generation (singles/doubles), hints.run label assignment, label_keys, motion key exclusion, visualizer registry
test_modifiers 6 weight_distance (manhattan distance, metadata), modifier registry
test_extractors 7 Lines/pass_through extractors, extractor registry (keys, metadata)
test_text_search 8 Text search extractor: literal matches, target type, metadata, registry variants (1/2-char, until)
test_presets 20 All preset motions (words/lines/search/delete/yank/change/paste), composable flag, preset exclusion
test_search 6 char_state save/get, collector/filter registry completeness
test_consts 10 All enum values, patterns, jump motions, namespace, defaults
test_motions 18 validate_motion_entry, register_motion, register_many, has_composable_with_prefix, get_composable_by_key
test_history 18 entry_key, add/last/clear, dedup, visit_count, frecency_score, serialization, get_pin, setup
test_engine_setup 6 setup.run returns ctx/cfg/ms, motion_key, shallow copy, EARLY_EXIT, metadata merge, per-mode overrides
test_filetype_dispatch 7 Pipeline module swapping, motion_state merges, deep copy safety, filetype_overrides cleanup
test_collectors 10 Patterns collector (matches, whole-line, max_lines, metadata), quickfix collector, lines collector
test_diagnostics_collector 5 Empty diagnostics, yields from buffer, severity filter (single/multiple), metadata
test_marks_collector 4 No marks empty, yields local marks, marks_local_only filter, metadata
test_module_loader 6 get_modules, get_module, get_module_by_name, fallback to default, infer action resolution
test_char_repeat 6 _find_matches literal search, _filter_by_direction after/before cursor, cross-window passthrough
test_merge 6 merge_actions chain execution/order/metadata, merge_filters, error on unknown
test_visual_select 4 _collect_word_targets, textobject_select visual selection
test_pass_through_visualizer 4 Selects first target, EARLY_EXIT on empty, pre-selected target, metadata
test_plugin_api 14 Public API surfaces (7 registry types), merge utilities, consts, custom registration, multiple setup calls

Infrastructure

  • deps/mini_test.lua - Vendored mini.test (no plenary dependency)
  • tests/run_tests.lua - Headless test runner entry point
  • tests/helpers.lua - Shared utilities (setup, buffer creation, cursor, context building, cleanup)
  • Makefile - make test and make test-file FILE=...
  • .github/workflows/test.yml - CI on Neovim 0.10.4, stable, nightly

Test plan

  • All 445 tests pass locally
  • CI passes on all 3 Neovim versions

Phase 1 of automated testing:
- Vendor mini.test for zero-dependency headless test runner
- Add test runner (tests/run_tests.lua), helpers, and Makefile
- Add GitHub Actions CI workflow (Neovim 0.10, stable, nightly)
- Add 67 tests covering config validation and exit event system
Phase 2 tests covering:
- Jump, restore, yank actions individually
- Action merge utility (composable chains)
- Jump + yank + restore chain preserves cursor (issue #140)
- Jump + yank without restore moves cursor (control case)
- Registered yank_jump action includes restore
- auto_select_target sets target when one exists (issue #141)
- auto_select_target disabled goes to selection
- count_select sets correct target with clamping
- Module loader resolves valid names
- Module loader handles missing modules without crash
…ts tests

Adds 6 new test files covering core plugin modules:
- test_state: init, create, finalize (label math), reset, merge
- test_pipeline: collectors, extractors, modifiers, filters, and
  full collect→extract→filter integration
- test_registry: register, lookup by name/key, register_many, override,
  default metadata, registries manager
- test_highlight: dim_background toggle, clear extmarks, single/double
  hint label placement
- test_flow_state: cancel keys, lifecycle (start/pause/resume/exit/reset),
  expiration with zero and non-zero timeout, evaluate_flow_at_motion_start
- test_targets: format_target, get_target_under_cursor (word/line/mid-word),
  get_targets with coroutine generator, before_cursor reversal

Total: 159 tests across 10 files, all passing.
Adds 13 new test files covering previously untested modules:

- test_filters: all direction filters, cursor_line_only,
  visible_lines, first_target, filter merge, multi-window bypass
- test_actions_extended: resolve_range, set_register, delete,
  delete_line, yank_line, change, change_line, paste, center,
  registered action chains
- test_selection_handlers: all 6 handlers (select_first/last,
  toggle hint/direction/multi-window, expand scope)
- test_label_conflict: conflict detection and key filtering
- test_fuzzy: FZY match algorithm and find_matches_in_line
- test_context: context.get() fields and windows list
- test_utils: is_non_empty_string, prepare_motion, module_wrapper
- test_hints: label generation, assignment, label_keys, motion key
  exclusion, visualizer registry
- test_modifiers: weight_distance modifier and registry
- test_extractors: lines/pass_through extractors and registry
- test_presets: all preset motions, composable flag, exclusion
- test_search: char_state, collector/filter registry completeness
- test_consts: all enum values and constants
…rs, module loader tests

Adds 65 new tests across 6 files:
- test_motions.lua (18): validate_motion_entry, register_motion,
  register_many_motions, has_composable_with_prefix, get_composable_by_key
- test_history.lua (18): entry_key, add/last/clear, dedup, visit_count,
  frecency_score, serialization, get_pin, setup
- test_filetype_dispatch.lua (7): pipeline module swapping, motion_state
  merges, deep copy safety, filetype_overrides cleanup
- test_collectors.lua (10): patterns collector (matches, whole-line,
  max_lines, metadata), quickfix collector, lines collector
- test_module_loader.lua (6): get_modules, get_module, get_module_by_name,
  fallback to default, infer action resolution
- test_engine_setup.lua (6): setup.run returns ctx/cfg/ms, motion_key,
  shallow copy, early exit for unknown key, metadata merge

Total: 372 tests, 29 files, 0 failures.
…lect tests

Adds 25 new tests across 5 files:
- test_char_repeat.lua (6): _find_matches literal search, _filter_by_direction
  after/before cursor, cross-window passthrough
- test_highlight_setup.lua (4): default highlight groups, custom colors,
  string group names, background highlights
- test_merge.lua (6): merge_actions chain execution/order/metadata,
  merge_filters, error on unknown module
- test_diagnostics_collector.lua (5): empty diagnostics, yields from buffer,
  severity filter (single and multiple), metadata
- test_visual_select.lua (4): _collect_word_targets, textobject_select
  visual selection

Total: 397 tests, 34 files, 0 failures.
Adds 26 new tests across 3 files:
- test_text_search.lua (8): literal match extraction, no match, target
  type, metadata preservation, registry variants (1_char, 2_char,
  2_char_until), num_of_char and exclude_target metadata
- test_marks_collector.lua (4): no marks yields nothing, yields local
  marks, marks_local_only filter, collector metadata
- test_plugin_api.lua (14): public API surfaces for all 7 registry types
  (motions, collectors, extractors, filters, visualizers, actions,
  selection_handlers), merge utilities, consts, custom registration
  via API, multiple setup calls, preset exclusion

Total: 423 tests, 37 files, 0 failures.
Adds 9 new tests:
- pipeline.run integration (3): word targets, line targets, label counts
- engine loop single-pass (2): EARLY_EXIT on empty buffer, count_select
- multi-window collector (1): single window fallback
- words extractor coroutine (3): positions, punctuation, target type

Total: 432 tests, 38 files, 0 failures.
…tion tests

Adds 22 new tests across 3 files:
- test_pass_through_visualizer.lua (4): selects first target, EARLY_EXIT
  on empty, uses pre-selected target, dim_background metadata
- test_composed_filters.lua (9): all composed filter registrations verified,
  direction metadata (AFTER/BEFORE/BOTH), cursor-line-after behavioral test,
  merged vs non-merged metadata
- test_pipeline_integration.lua (9): full pipeline word/line collection,
  label count finalization, engine loop EARLY_EXIT/count_select, multi-window
  fallback, words extractor positions/punctuation/type

Total: 445 tests, 40 files, 0 failures.
Tests for disk I/O round-trips, corrupt file handling, version
compatibility, entry expiry, merge-with-disk deduplication, and
global pin persistence. 25 new tests, 470 total.
@FluxxField
FluxxField merged commit 790dd3a into dev Mar 9, 2026
0 of 3 checks passed
@FluxxField
FluxxField deleted the feat/integration-tests branch March 9, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant