Documentation ¶
Overview ¶
Package edittest contains utility functions for testing edits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseState ¶
ParseState parses an editor state description.
An editor state description describes the contents of the buffer and the editor's marks. Runes that are not between { and } represent the buffer contents. Each rune between { and } represent the beginning (first occurrence) or end (second occurrence) of a mark region with the name of the rune.
As a special case, the empty string, "", is equal to "{..}".
For example:
"{mm}abc{.}xyz{.n}123{n}αβξ"
Is a buffer with the contents:
"abcxyz123αβξ"
The mark m is the empty string at the beginning of the buffer. The mark . contains the text "xyz". The mark n contains the text "123".
func StateEquals ¶
StateEquals returns whether the state (text plus marks) equals the described state.
func StateString ¶
StateString returns the state string description of the text and marks. The returned string is in the format of ParseState. The returned string is normalized so that multiple marks within { and } are lexicographically ordered.