[go: up one dir, main page]

Add test suite for misc.lua utility functions

Overview

The misc.lua module (~94 lines) contains miscellaneous utility functions with no test coverage.

Functions Needing Tests

Slides Presentation

  • slides() - Present note as slides
    • Test: checks for slides executable
    • Test: shows error when slides not found
    • Test: handles no file in buffer
    • Test: saves file if modified
    • Test: opens slides in terminal tab
    • Test: handles unsaved changes dialog
    • Test: handles user canceling save
    • Test: executes correct slides command

Update Command

  • update() - Run zk update
    • Test: finds .zk directory
    • Test: shows error when .zk not found
    • Test: executes zk update command
    • Test: captures command output
    • Test: shows output in quickfix list
    • Test: shows success notification
    • Test: shows error notification on failure
    • Test: handles zk command not found

Edge Cases

  • slides executable in PATH vs not available
  • File with unsaved changes
  • File not on disk yet (unnamed buffer)
  • zk update with errors in output
  • Very large zk update output
  • Concurrent zk update calls

Test File Location

tests/zk-extras/misc_spec.lua

Priority

Low - Less critical functionality but still needs coverage

Notes

  • Slides testing may need mocking of terminal commands
  • zk update testing may need mocking of system calls