diff options
author | Oliver Looney <88001922+Oliver-Looney@users.noreply.github.com> | 2024-02-11 22:53:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-11 22:53:48 +0000 |
commit | c3f2ddf5092e9f81052e3183fdbf5ae68147a8af (patch) | |
tree | 5db103ecca22c96828cfed69dff304be35c4631f /tests | |
parent | 8a51172b119d95fd5984ad46639307140b675c1b (diff) | |
parent | 5a2a20af42e7a426943122524287844acc5ee975 (diff) |
Merge branch 'master' into 2783-setting-terminal-title
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/benchmarks/run-benchmarks.sh | 53 | ||||
-rw-r--r-- | tests/benchmarks/startup-time-src/Containerfile | 3 | ||||
-rw-r--r-- | tests/benchmarks/startup-time-src/mystery-file | 3 | ||||
-rw-r--r-- | tests/examples/regression_tests/issue_2541.txt | 1 | ||||
-rw-r--r-- | tests/examples/this-file-path-is-really-long-and-would-have-broken-the-layout-of-the-header.txt | 1 | ||||
-rw-r--r-- | tests/integration_tests.rs | 125 | ||||
-rw-r--r-- | tests/syntax-tests/highlighted/JQ/sample.jq | 32 |
7 files changed, 201 insertions, 17 deletions
diff --git a/tests/benchmarks/run-benchmarks.sh b/tests/benchmarks/run-benchmarks.sh index 0f43bc6b..2809ccbb 100755 --- a/tests/benchmarks/run-benchmarks.sh +++ b/tests/benchmarks/run-benchmarks.sh @@ -9,6 +9,13 @@ if ! command -v hyperfine > /dev/null 2>&1; then exit 1 fi +# Check that jq is installed. +if ! command -v jq > /dev/null 2>&1; then + echo "'jq' does not seem to be installed." + echo "You can get it here: https://jqlang.github.io/jq/download/" + exit 1 +fi + # Check that python3 is installed. if ! command -v python3 > /dev/null 2>&1; then echo "'python3' does not seem to be installed." @@ -95,10 +102,20 @@ hyperfine \ cat "$RESULT_DIR/startup-time.md" >> "$REPORT" +heading "Startup time without syntax highlighting" +hyperfine \ + "$(printf "%q" "$BAT") --no-config startup-time-src/small-CpuInfo-file.cpuinfo" \ + --command-name "bat … small-CpuInfo-file.cpuinfo" \ + --warmup "$WARMUP_COUNT" \ + --runs "$RUN_COUNT" \ + --export-markdown "$RESULT_DIR/startup-time-without-syntax-highlighting.md" \ + --export-json "$RESULT_DIR/startup-time-without-syntax-highlighting.json" +cat "$RESULT_DIR/startup-time-without-syntax-highlighting.md" >> "$REPORT" + heading "Startup time with syntax highlighting" hyperfine \ "$(printf "%q" "$BAT") --no-config --color=always startup-time-src/small-CpuInfo-file.cpuinfo" \ - --command-name "bat … small-CpuInfo-file.cpuinfo" \ + --command-name "bat … --color=always small-CpuInfo-file.cpuinfo" \ --warmup "$WARMUP_COUNT" \ --runs "$RUN_COUNT" \ --export-markdown "$RESULT_DIR/startup-time-with-syntax-highlighting.md" \ @@ -117,6 +134,40 @@ hyperfine \ cat "$RESULT_DIR/startup-time-with-syntax-with-dependencies.md" >> "$REPORT" +heading "Startup time with indeterminant syntax" +hyperfine \ + "$(printf "%q" "$BAT") --no-config --color=always startup-time-src/mystery-file" \ + --shell none \ + --command-name 'bat … mystery-file' \ + --warmup "$WARMUP_COUNT" \ + --runs "$RUN_COUNT" \ + --export-markdown "$RESULT_DIR/startup-time-with-indeterminant-syntax.md" \ + --export-json "$RESULT_DIR/startup-time-with-indeterminant-syntax.json" +cat "$RESULT_DIR/startup-time-with-indeterminant-syntax.md" >> "$REPORT" + +heading "Startup time with manually set syntax" +hyperfine \ + "$(printf "%q" "$BAT") --no-config --color=always --language=Dockerfile startup-time-src/mystery-file" \ + --shell none \ + --command-name 'bat … --language=Dockerfile mystery-file' \ + --warmup "$WARMUP_COUNT" \ + --runs "$RUN_COUNT" \ + --export-markdown "$RESULT_DIR/startup-time-with-manually-set-syntax.md" \ + --export-json "$RESULT_DIR/startup-time-with-manually-set-syntax.json" +cat "$RESULT_DIR/startup-time-with-manually-set-syntax.md" >> "$REPORT" + +heading "Startup time with mapped syntax" +hyperfine \ + "$(printf "%q" "$BAT") --no-config --color=always startup-time-src/Containerfile" \ + --shell none \ + --command-name 'bat … Containerfile' \ + --warmup "$WARMUP_COUNT" \ + --runs "$RUN_COUNT" \ + --export-markdown "$RESULT_DIR/startup-time-with-mapped-syntax.md" \ + --export-json "$RESULT_DIR/startup-time-with-mapped-syntax.json" +cat "$RESULT_DIR/startup-time-with-mapped-syntax.md" >> "$REPORT" + + heading "Plain-text speed" hyperfine \ "$(printf "%q" "$BAT") --no-config --language=txt --style=plain highlighting-speed-src/numpy_test_multiarray.py" \ diff --git a/tests/benchmarks/startup-time-src/Containerfile b/tests/benchmarks/startup-time-src/Containerfile new file mode 100644 index 00000000..a93ce851 --- /dev/null +++ b/tests/benchmarks/startup-time-src/Containerfile @@ -0,0 +1,3 @@ +FROM docker.io/alpine:latest +COPY foo /root/bar +RUN sleep 60 diff --git a/tests/benchmarks/startup-time-src/mystery-file b/tests/benchmarks/startup-time-src/mystery-file new file mode 100644 index 00000000..a93ce851 --- /dev/null +++ b/tests/benchmarks/startup-time-src/mystery-file @@ -0,0 +1,3 @@ +FROM docker.io/alpine:latest +COPY foo /root/bar +RUN sleep 60 diff --git a/tests/examples/regression_tests/issue_2541.txt b/tests/examples/regression_tests/issue_2541.txt new file mode 100644 index 00000000..1059b94e --- /dev/null +++ b/tests/examples/regression_tests/issue_2541.txt @@ -0,0 +1 @@ +]8;;http://example.com\This is a link]8;;\n
\ No newline at end of file diff --git a/tests/examples/this-file-path-is-really-long-and-would-have-broken-the-layout-of-the-header.txt b/tests/examples/this-file-path-is-really-long-and-would-have-broken-the-layout-of-the-header.txt new file mode 100644 index 00000000..4dac98dc --- /dev/null +++ b/tests/examples/this-file-path-is-really-long-and-would-have-broken-the-layout-of-the-header.txt @@ -0,0 +1 @@ +The header is not broken
\ No newline at end of file diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index f1a22d9d..3612654b 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1175,6 +1175,20 @@ fn bom_stripped_when_no_color_and_not_loop_through() { ); } +// Regression test for https://github.com/sharkdp/bat/issues/2541 +#[test] +fn no_broken_osc_emit_with_line_wrapping() { + bat() + .arg("--color=always") + .arg("--decorations=never") + .arg("--wrap=character") + .arg("--terminal-width=40") + .arg("regression_tests/issue_2541.txt") + .assert() + .success() + .stdout(predicate::function(|s: &str| s.lines().count() == 1)); +} + #[test] fn can_print_file_named_cache() { bat_with_config() @@ -1394,6 +1408,61 @@ fn header_full_binary() { } #[test] +#[cfg(not(feature = "git"))] +fn header_narrow_terminal() { + bat() + .arg("--terminal-width=30") + .arg("--decorations=always") + .arg("this-file-path-is-really-long-and-would-have-broken-the-layout-of-the-header.txt") + .assert() + .success() + .stdout( + "\ +─────┬──────────────────────── + │ File: this-file-path-is + │ -really-long-and-would- + │ have-broken-the-layout- + │ of-the-header.txt +─────┼──────────────────────── + 1 │ The header is not broke + │ n +─────┴──────────────────────── +", + ) + .stderr(""); +} + +#[test] +fn header_very_narrow_terminal() { + bat() + .arg("--terminal-width=10") + .arg("--decorations=always") + .arg("this-file-path-is-really-long-and-would-have-broken-the-layout-of-the-header.txt") + .assert() + .success() + .stdout( + "\ +────────── +File: this +-file-path +-is-really +-long-and- +would-have +-broken-th +e-layout-o +f-the-head +er.txt +────────── +The header + is not br +oken +────────── +", + ) + .stderr(""); +} + +#[test] #[cfg(feature = "git")] // Expected output assumes git is enabled fn header_default() { bat() @@ -1876,6 +1945,62 @@ fn ansi_passthrough_emit() { } } +// Ensure that a simple ANSI sequence passthrough is emitted properly on wrapped lines. +// This also helps ensure that escape sequences are counted as part of the visible characters when wrapping. +#[test] +fn ansi_sgr_emitted_when_wrapped() { + bat() + .arg("--paging=never") + .arg("--color=never") + .arg("--terminal-width=20") + .arg("--wrap=character") + .arg("--decorations=always") + .arg("--style=plain") + .write_stdin("\x1B[33mColor...............Also color.\n") + .assert() + .success() + .stdout("\x1B[33m\x1B[33mColor...............\n\x1B[33mAlso color.\n") + // FIXME: ~~~~~~~~ should not be emitted twice. + .stderr(""); +} + +// Ensure that a simple ANSI sequence passthrough is emitted properly on wrapped lines. +// This also helps ensure that escape sequences are counted as part of the visible characters when wrapping. +#[test] +fn ansi_hyperlink_emitted_when_wrapped() { + bat() + .arg("--paging=never") + .arg("--color=never") + .arg("--terminal-width=20") + .arg("--wrap=character") + .arg("--decorations=always") + .arg("--style=plain") + .write_stdin("\x1B]8;;http://example.com/\x1B\\Hyperlinks..........Wrap across lines.\n") + .assert() + .success() + .stdout("\x1B]8;;http://example.com/\x1B\\\x1B]8;;http://example.com/\x1B\\Hyperlinks..........\x1B]8;;\x1B\\\n\x1B]8;;http://example.com/\x1B\\Wrap across lines.\n") + // FIXME: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ should not be emitted twice. + .stderr(""); +} + +// Ensure that multiple ANSI sequence SGR attributes are combined when emitted on wrapped lines. +#[test] +fn ansi_sgr_joins_attributes_when_wrapped() { + bat() + .arg("--paging=never") + .arg("--color=never") + .arg("--terminal-width=20") + .arg("--wrap=character") + .arg("--decorations=always") + .arg("--style=plain") + .write_stdin("\x1B[33mColor. \x1B[1mBold.........Also bold and color.\n") + .assert() + .success() + .stdout("\x1B[33m\x1B[33mColor. \x1B[1m\x1B[33m\x1B[1mBold.........\n\x1B[33m\x1B[1mAlso bold and color.\n") + // FIXME: ~~~~~~~~ ~~~~~~~~~~~~~~~ should not be emitted twice. + .stderr(""); +} + #[test] fn ignored_suffix_arg() { bat() diff --git a/tests/syntax-tests/highlighted/JQ/sample.jq b/tests/syntax-tests/highlighted/JQ/sample.jq index ba9c853f..057e9edd 100644 --- a/tests/syntax-tests/highlighted/JQ/sample.jq +++ b/tests/syntax-tests/highlighted/JQ/sample.jq @@ -1,31 +1,31 @@ [38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m../imported-file[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;248;248;242m;[0m [38;2;117;113;94m#[0m[38;2;117;113;94m With Comments ![0m -[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mweird[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m$a[0m[38;2;248;248;242m; [0m[3;38;2;253;151;31m$b[0m[38;2;248;248;242m; [0m[3;38;2;253;151;31m$c[0m[38;2;248;248;242m)[0m[38;2;248;248;242m:[0m -[38;2;248;248;242m [0m[38;2;248;248;242m[ [0m[38;2;255;255;255m$a[0m[38;2;248;248;242m, [0m[38;2;255;255;255m$b[0m[38;2;248;248;242m, [0m[38;2;255;255;255m$c[0m[38;2;248;248;242m ][0m[38;2;248;248;242m | [0m[38;2;102;217;239mtranspose[0m[38;2;248;248;242m | [0m[38;2;249;38;114mreduce[0m[38;2;248;248;242m .[0m[38;2;248;248;242m[][0m[38;2;248;248;242m[][0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;255;255;255m$item[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m -[38;2;248;248;242m [0m[38;2;248;248;242m[][0m[38;2;248;248;242m;[0m -[38;2;248;248;242m . + [0m[38;2;255;255;255m$item[0m[38;2;248;248;242m.property[0m -[38;2;248;248;242m )[0m +[38;2;249;38;114mdef[0m[38;2;248;248;242m [0m[38;2;166;226;46mweird[0m[38;2;248;248;242m([0m[3;38;2;253;151;31m$a[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m$b[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m$c[0m[38;2;248;248;242m)[0m[38;2;248;248;242m:[0m +[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m [0m[38;2;255;255;255m$[0m[38;2;255;255;255ma[0m[38;2;248;248;242m, [0m[38;2;255;255;255m$[0m[38;2;255;255;255mb[0m[38;2;248;248;242m, [0m[38;2;255;255;255m$[0m[38;2;255;255;255mc[0m[38;2;248;248;242m [0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;102;217;239mtranspose[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;249;38;114mreduce[0m[38;2;248;248;242m [0m[38;2;248;248;242m.[0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;255;255;255m$[0m[38;2;255;255;255mitem[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m +[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m.[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;255;255;255m$[0m[38;2;255;255;255mitem[0m[38;2;248;248;242m.[0m[38;2;248;248;242mproperty[0m +[38;2;248;248;242m [0m[38;2;248;248;242m)[0m [38;2;248;248;242m;[0m -[38;2;248;248;242m. | weird [0m[38;2;248;248;242m(.a; .b; .c)[0m[38;2;248;248;242m |[0m +[38;2;248;248;242m.[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m weird [0m[38;2;248;248;242m([0m[38;2;248;248;242m.[0m[38;2;248;248;242ma[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;248;248;242m.[0m[38;2;248;248;242mb[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;248;248;242m.[0m[38;2;248;248;242mc[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m [38;2;248;248;242m([0m -[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m(. | [0m[38;2;102;217;239mcontains[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mnever[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m )[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m +[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m.[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;102;217;239mcontains[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mnever[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m [38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mWhy yes[0m[38;2;230;219;116m"[0m [38;2;249;38;114melse[0m [38;2;248;248;242m [0m[38;2;190;132;255m12.23[0m [38;2;249;38;114mend[0m -[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;255;255;255m$never[0m[38;2;248;248;242m |[0m +[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;255;255;255m$[0m[38;2;255;255;255mnever[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m [38;2;248;248;242m{[0m [38;2;248;248;242m [0m[38;2;166;226;46mhello[0m[38;2;248;248;242m,[0m [38;2;248;248;242m [0m[38;2;166;226;46mwhy[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mbecause[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m -[38;2;248;248;242m [0m[38;2;166;226;46mhello[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m( weird | [0m[38;2;102;217;239mascii_upcase[0m[38;2;248;248;242m )[0m[38;2;248;248;242m,[0m -[38;2;248;248;242m [0m[38;2;166;226;46mformat_eg[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m( . | [0m[38;2;190;132;255m@json[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mMy json string [0m[38;2;190;132;255m\([0m[38;2;248;248;242m . | this | part | just | white | ascii_upcase | transpose[0m[38;2;190;132;255m)[0m[38;2;230;219;116m"[0m[38;2;248;248;242m )[0m[38;2;248;248;242m,[0m -[38;2;248;248;242m [0m[38;2;166;226;46mnever[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;255;255;255m$never[0m[38;2;248;248;242m,[0m +[38;2;248;248;242m [0m[38;2;166;226;46mhello[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m weird [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;102;217;239mascii_upcase[0m[38;2;248;248;242m [0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m +[38;2;248;248;242m [0m[38;2;166;226;46mformat_eg[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m [0m[38;2;248;248;242m.[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;190;132;255m@json[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mMy json string [0m[38;2;190;132;255m\([0m[38;2;248;248;242m . | this | part | just | white | ascii_upcase | transpose[0m[38;2;190;132;255m)[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m +[38;2;248;248;242m [0m[38;2;166;226;46mnever[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;255;255;255m$[0m[38;2;255;255;255mnever[0m[38;2;248;248;242m,[0m [38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mliteral_key[0m[38;2;230;219;116m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m literal_value[0m[38;2;248;248;242m,[0m [38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mthis[0m[38;2;230;219;116m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m12.1e12[0m[38;2;248;248;242m,[0m [38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mpart[0m[38;2;230;219;116m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116malmost[0m[38;2;230;219;116m"[0m @@ -38,8 +38,8 @@ [38;2;248;248;242m [0m[38;2;166;226;46msimilar[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mbut not quite[0m[38;2;230;219;116m"[0m [38;2;248;248;242m [0m[38;2;248;248;242m}[0m [38;2;248;248;242m [0m[38;2;248;248;242m}[0m -[38;2;248;248;242m ][0m[38;2;248;248;242m,[0m -[38;2;248;248;242m}[0m[38;2;248;248;242m | [0m[38;2;248;248;242m([0m +[38;2;248;248;242m [0m[38;2;248;248;242m][0m[38;2;248;248;242m,[0m +[38;2;248;248;242m}[0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m [38;2;248;248;242m [0m [38;2;248;248;242m [0m[38;2;117;113;94m#[0m[38;2;117;113;94m And with very basic brace matching[0m [38;2;248;248;242m [0m @@ -47,13 +47,13 @@ [38;2;248;248;242m [0m[38;2;248;248;240m][0m[38;2;248;248;242m [0m [38;2;248;248;242m [0m [38;2;248;248;242m [0m[38;2;117;113;94m#[0m[38;2;117;113;94m Other invalid ends[0m -[38;2;248;248;242m [0m[38;2;248;248;242m( [0m[38;2;248;248;242m[ [0m[38;2;248;248;240m}[0m[38;2;248;248;242m [0m[38;2;248;248;240m][0m[38;2;248;248;242m )[0m +[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m [0m[38;2;248;248;240m}[0m[38;2;248;248;242m [0m[38;2;248;248;240m][0m[38;2;248;248;242m )[0m [38;2;248;248;242m [0m[38;2;117;113;94m#[0m[38;2;117;113;94m A "valid" sequence[0m -[38;2;248;248;242m [0m[38;2;248;248;242m( [0m[38;2;248;248;242m[ [0m[38;2;248;248;242m{ [0m[38;2;166;226;46mkey[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m()[0m[38;2;248;248;242m [0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mother_key[0m[38;2;248;248;242m:[0m[38;2;248;248;242m( [0m[38;2;248;248;242m[ [0m[38;2;248;248;242m[][0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m[][0m[38;2;248;248;242m][0m[38;2;248;248;242m ][0m[38;2;248;248;242m )[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mgaga[0m[38;2;248;248;242m }[0m[38;2;248;248;242m ][0m[38;2;248;248;242m )[0m +[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m[38;2;248;248;242m [0m[38;2;166;226;46mkey[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mother_key[0m[38;2;248;248;242m:[0m[38;2;248;248;242m([0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m)[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mgaga[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m [0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m)[0m [38;2;248;248;242m [0m[38;2;117;113;94m#[0m[38;2;117;113;94m A "invalid" sequence[0m -[38;2;248;248;242m [0m[38;2;248;248;242m( [0m[38;2;248;248;242m[ [0m[38;2;248;248;242m{ [0m[38;2;166;226;46mkey[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m()[0m[38;2;248;248;242m [0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mother_key[0m[38;2;248;248;242m:[0m[38;2;248;248;242m( [0m[38;2;248;248;242m[ [0m[38;2;248;248;242m[][0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m[][0m[38;2;248;248;242m ][0m[38;2;248;248;242m [0m[38;2;248;248;240m)[0m[38;2;248;248;242m, gaga [0m[38;2;248;248;240m}[0m[38;2;248;248;242m ] )[0m +[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m[38;2;248;248;242m [0m[38;2;166;226;46mkey[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;166;226;46mother_key[0m[38;2;248;248;242m:[0m[38;2;248;248;242m([0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[38;2;248;248;242m[[0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;242m][0m[38;2;248;248;242m [0m[38;2;248;248;240m)[0m[38;2;248;248;242m, gaga [0m[38;2;248;248;240m}[0m[38;2;248;248;242m ] )[0m [38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mA string[0m[38;2;190;132;255m\[0m[38;2;190;132;255mn[0m[38;2;230;219;116m whith escaped characters [0m[38;2;190;132;255m\[0m[38;2;190;132;255m"[0m[38;2;230;219;116m because we can[0m[38;2;230;219;116m"[0m [38;2;248;248;242m)[0m |