mirror of
https://github.com/zaerl/mojibake.git
synced 2026-12-01 16:56:40 +01:00
* Initial support Signed-off-by: Francesco Bigiarini <francesco.bigiarini@gmail.com> * Show control character as in the shell * Add codepoint clickable links * Add normalization view * Add filter view * Add emoji view * Update "about Mojibake" panel * Add case view * Add breaks view * Add grouped view * Add bidi view * Change mjb_display_width to mjb_terminal_width * Add terminal width view * Windows: fix C4310 warning --------- Signed-off-by: Francesco Bigiarini <francesco.bigiarini@gmail.com>
25 lines
1007 B
CMake
25 lines
1007 B
CMake
# The Mojibake library
|
|
#
|
|
# This file is distributed under the MIT License. See LICENSE for details.
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/assert-command.cmake")
|
|
|
|
mjb_assert_shell_command(
|
|
ARGS --output json break all "a b"
|
|
OUTPUT
|
|
"{\"raw_input_size\":3,\"real_input_size\":3,\"terminal_width\":3,\"raw_bytes\":[97,32,98],\"grapheme_breaks\":[\"allowed\",\"allowed\",\"allowed\"],\"word_breaks\":[\"allowed\",\"allowed\",\"allowed\"],\"line_breaks\":[\"no_break\",\"allowed\",\"mandatory\"],\"sentence_breaks\":[\"no_break\",\"no_break\",\"allowed\"]}\n"
|
|
)
|
|
|
|
mjb_assert_shell_command(
|
|
ARGS --output json --json-indent 2 break line "a b"
|
|
OUTPUT
|
|
"{\n \"raw_input_size\": 3,\n \"real_input_size\": 3,\n \"terminal_width\": 3,\n \"raw_bytes\": [97, 32, 98],\n \"line_breaks\": [\"no_break\", \"allowed\", \"mandatory\"]\n}\n"
|
|
)
|
|
|
|
mjb_assert_shell_command(
|
|
ARGS --output json break
|
|
STATUS 1
|
|
ERROR ""
|
|
OUTPUT "{\"error\":\"break: JSON output requires an input\"}"
|
|
)
|