helix

The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not helix’s official test suite, and the helix project is not affiliated with atago.

Summary #

1 suite · 21 scenarios

Contents #

helix (third-party modal editor) #

Helix is a modal text editor, driven here as a person drives it: the real TUI is launched in a terminal, keys are typed in normal and insert mode, and commands are issued at the prompt.

What is asserted is what survives the editor — the file on disk. A save must write the edited text; a quit-without-saving must leave the original untouched; and a multi-file workflow must put each change in the right file. Full-screen snapshots are deliberately avoided: they break when a status bar changes, while “did the edit land?” is the contract that actually matters.

Source: test/e2e/thirdparty/helix/helix.atago.yaml

Scenario: version prints the pinned release #

only when hx --version succeeds

When #

hx --version

Then #

  • exit code is 0
  • stdout contains helix 25.07.1

Scenario: opening an existing file reaches the editor and quits cleanly #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha

When #

# interactive (pty): hx note.txt

Then #

  • exit code is 0

Scenario: append mode edits an existing file and write quit saves it #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout contains alpha beta

Scenario: insert mode prefixes the first line and write quit saves it #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: append mode after j edits only the second line #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

first
second

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

first
second updated

Scenario: force quit discards unsaved changes #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: saving a new file path creates the file on disk #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

When #

# interactive (pty): hx fresh.txt
cat fresh.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: saving a new file path under an existing directory creates the file #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file dir/.keep is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

When #

# interactive (pty): hx dir/fresh.txt
cat dir/fresh.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: enter in insert mode writes multiple lines #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

When #

# interactive (pty): hx lines.txt
cat lines.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

first
second

Scenario: o opens a line below the current line #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

first
third

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

first
second
third

Scenario: capital O opens a line above the current line #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

second
third

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

first
second
third

Scenario: undo removes an appended edit before save #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: x d then undo restores the deleted line before save #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

first
second

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

first
second

Scenario: search selects a match and change replaces only that match #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha beta gamma

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: x then d deletes the selected line and saves the shorter file #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

first
second

When #

# interactive (pty): hx note.txt
cat note.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: buffer-next switches to the second file in a multi-file session #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file one.txt is created.
  • Fixture file two.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture one.txt:

one-start

Fixture two.txt:

two-start

When #

# interactive (pty): hx one.txt two.txt
cat two.txt

Then #

  • exit code is 0
  • stdout contains two-start updated

Scenario: buffer-previous returns to the first file in a multi-file session #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file one.txt is created.
  • Fixture file two.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture one.txt:

one-start

Fixture two.txt:

two-start

When #

# interactive (pty): hx one.txt two.txt
cat one.txt

Then #

  • exit code is 0
  • stdout contains one-start updated

Scenario: buffer-next then buffer-previous can edit both buffers before quit #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file one.txt is created.
  • Fixture file two.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture one.txt:

one-start

Fixture two.txt:

two-start

When #

# interactive (pty): hx one.txt two.txt
cat one.txt
cat two.txt

Then #

  • after cat one.txt:
    • exit code is 0
    • stdout contains one-start first
  • after cat two.txt:
    • exit code is 0
    • stdout contains two-start second

Scenario: write saves a copy to another path without changing the source file #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • Fixture file note.txt is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

Fixture note.txt:

alpha

When #

# interactive (pty): hx note.txt
cat note.txt
cat copy.txt

Then #

  • after cat note.txt:
    • exit code is 0
    • stdout equals an exact value
  • after cat copy.txt:
    • exit code is 0
    • stdout equals an exact value

Scenario: unicode filenames and Japanese text save without mangling #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

When #

# interactive (pty): hx 日本語メモ.txt
cat 日本語メモ.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: wide and combining characters round-trip through a save #

only when hx --version succeeds · skipped on Windows

Given #

  • Fixture file cfg/config.toml is created.
  • The command runs with a cleared environment (passing through: PATH, HELIX_RUNTIME).

Inputs #

Fixture cfg/config.toml:

theme = "default"
[editor]
mouse = false
auto-save = false

When #

# interactive (pty): hx unicode.txt
od -An -tx1 -v unicode.txt

Then #

  • exit code is 0
  • stdout contains 65 cc 81