diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 16685647f..1e83fc205 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,15 +1,10 @@ name: CI on: - push: - branches: - - 'master' - tags: '*' pull_request: types: - opened - reopened - synchronize - - ready_for_review jobs: test: @@ -21,7 +16,7 @@ jobs: version: - '1.6' - '1' # latest 1.X - # - 'nightly' + - 'nightly' os: - ubuntu-latest - windows-latest diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml new file mode 100644 index 000000000..b1b2b6e68 --- /dev/null +++ b/.github/workflows/Invalidations.yml @@ -0,0 +1,44 @@ +name: Invalidations + +on: + pull_request: + types: + - ready_for_review + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: always. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + evaluate: + # Only run on PRs to the default branch. + # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch + if: github.base_ref == github.event.repository.default_branch + runs-on: ubuntu-latest + steps: + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - uses: actions/checkout@v3 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-invalidations@v1 + id: invs_pr + + + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.repository.default_branch }} + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-invalidations@v1 + id: invs_default + + + - name: Report invalidation counts + run: | + echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + - name: Check if the PR does increase number of invalidations + if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total + run: exit 1 diff --git a/.github/workflows/unused_dependencies.yml b/.github/workflows/unused_dependencies.yml new file mode 100644 index 000000000..4d860a61c --- /dev/null +++ b/.github/workflows/unused_dependencies.yml @@ -0,0 +1,18 @@ +name: Check for unused dependencies + +on: + pull_request: + types: + - ready_for_review + + +jobs: + treeshake: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: 1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-treeshake@main diff --git a/Project.toml b/Project.toml index fa1aa7b78..3a2ba5137 100644 --- a/Project.toml +++ b/Project.toml @@ -1,9 +1,10 @@ name = "Term" uuid = "22787eb5-b846-44ae-b979-8e399b8463ab" authors = ["FedeClaudi and contributors"] -version = "1.1.1" +version = "1.2.0" [deps] +AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Highlights = "eafb193a-b7ab-5a9e-9068-77385905fa72" @@ -19,9 +20,9 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" UnicodeFun = "1cfade01-22cf-5700-b092-accc4b62d6e1" -WordTokenizers = "796a5d58-b03d-544a-977e-18100b691f6e" [compat] +AbstractTrees = "0.4" CodeTracking = "1" Highlights = "0.5" MyterialColors = "0.3" diff --git a/README.jl b/README.jl index d62c01588..e968ff0cc 100644 --- a/README.jl +++ b/README.jl @@ -1,7 +1,7 @@ using Term import Term.Renderables: Renderable import Term: rint -import Term: typestree, inspect +import Term: inspect using Term.Layout import Term.Measures: height @@ -172,7 +172,7 @@ lorem1 = TextBox(_lorem; width = 62, fit = false, padding = (0, 0, 0, 0)) lorem2 = TextBox(_lorem; width = 42, fit = false, padding = (0, 0, 0, 0)) expr = :(2x + 2π / θ) -tree = Renderable(sprint(typestree, Float64)) +tree = Renderable(sprint(Tree, Float64)) dendo = Renderable(sprint(inspect, expr)) renderables_info = TextBox( """{bold bright_blue}Renderables types{/bold bright_blue} diff --git a/codecov.yaml b/codecov.yaml index ec25b4419..f5bc6aa9f 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -2,5 +2,6 @@ ignore: - "./src/errors.jl" - "./src/_errors.jl" + - "./src/__precompilation.jl" - "./test" - "./scripts" \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 347fdfc52..ba4f17f13 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -23,6 +23,8 @@ makedocs(; "basics/renderables.md", "basics/tprint.md", "basics/console.md", + "basics/prompt.md", + "basics/markdown.md", ], "Renderables" => Any[ "ren/intro.md", @@ -30,6 +32,7 @@ makedocs(; "ren/panel.md", "ren/table.md", "ren/layout_rens.md", + "ren/annotation.md", "ren/dendogram.md", "ren/tree.md", ], @@ -48,7 +51,6 @@ makedocs(; "adv/logging.md", "adv/errors_tracebacks.md", "adv/introspection.md", - "adv/markdown.md", ], "API" => Any[ "api/api_term.md", diff --git a/docs/src/adv/errors_tracebacks.md b/docs/src/adv/errors_tracebacks.md index d1473baf2..bd05a902c 100644 --- a/docs/src/adv/errors_tracebacks.md +++ b/docs/src/adv/errors_tracebacks.md @@ -26,12 +26,26 @@ test() ![](stacktrace.png) -!!! warning "Term is opinionated" - In altering Julia's default stacktraces handling, a few choices where made such as: inveriting the order in which the backtrace's stack frames are shown and hiding frames from `Base` or other packages installed through `Pkg` (similarly to [AbbreviatedStackTraces.jl](https://github.com/BioTurboNick/AbbreviatedStackTraces.jl)). - When installing `Term`'s stacktrace system with `install_term_stacktrace`, you can use the keyword arguments to alter this behavior +### Term is opinionated + +In altering Julia's default stacktraces handling, a few choices where made such as: inveriting the order in which the backtrace's stack frames are shown and hiding frames from `Base` or other packages installed through `Pkg` (similarly to [AbbreviatedStackTraces.jl](https://github.com/BioTurboNick/AbbreviatedStackTraces.jl)). +When installing `Term`'s stacktrace system with `install_term_stacktrace`, you can use the keyword arguments to alter this behavior ```@example using Term # hide install_term_repr() # hide -install_term_stacktrace +install_term_stacktrace(; + reverse_backtrace = true, # change me! + max_n_frames = 30, + hide_frames = false, +) +``` + +but you can also do more, if you just want to quickly change some options (e.g. to deal with a particularly though bug). You can set flags to change the behavior on the fly: + +```@example +import Term: STACKTRACE_HIDDEN_MODULES, STACKTRACE_HIDE_FRAMES + +STACKTRACE_HIDDEN_MODULES[] = ["REPL", "OhMyREPL"] # list names of modules you want ignored in the stacktrace +STACKTRACE_HIDE_FRAMES[] = false # set to true to hide frame, false to show all of them ``` \ No newline at end of file diff --git a/docs/src/adv/introspection.md b/docs/src/adv/introspection.md index b26eeffde..e02fe0be3 100644 --- a/docs/src/adv/introspection.md +++ b/docs/src/adv/introspection.md @@ -12,7 +12,7 @@ You can now use `inspect(T::DataType)` to get all information you possibly need ```@meta -CurrentModule = Introspection +CurrentModule = Term.Introspection ``` ```@docs diff --git a/docs/src/api/api_annotations.md b/docs/src/api/api_annotations.md new file mode 100644 index 000000000..fbdfe42de --- /dev/null +++ b/docs/src/api/api_annotations.md @@ -0,0 +1,13 @@ +# Annotations +```@meta +CurrentModule = Term.Annotations +``` + + +```@index +Pages = ["api_annotations.md"] +``` + +```@autodocs +Modules = [Annotations] +``` \ No newline at end of file diff --git a/docs/src/api/api_prompt.md b/docs/src/api/api_prompt.md new file mode 100644 index 000000000..dd2461877 --- /dev/null +++ b/docs/src/api/api_prompt.md @@ -0,0 +1,14 @@ +# Prompts +```@meta +CurrentModule = Term.Prompts +``` + + +```@index +Pages = ["api_prompt.md"] +``` + + +```@autodocs +Modules = [Prompts] +``` \ No newline at end of file diff --git a/docs/src/basics/console.md b/docs/src/basics/console.md index 65bf01b60..7ba28e03e 100644 --- a/docs/src/basics/console.md +++ b/docs/src/basics/console.md @@ -24,7 +24,7 @@ tprintln("This is a very long text"^10) it also works for any `Renderable` made with Term: ```@example -using Term: tprintln # hide +using Term: tprintln, Panel # hide using Term.Consoles: Console, enable, disable #hide print(Panel()) diff --git a/docs/src/adv/markdown.md b/docs/src/basics/markdown.md similarity index 98% rename from docs/src/adv/markdown.md rename to docs/src/basics/markdown.md index c3c9aa39d..d9ce07b2c 100644 --- a/docs/src/adv/markdown.md +++ b/docs/src/basics/markdown.md @@ -5,7 +5,8 @@ Let's have a look. ```@example md import Term.Consoles: Console, enable, disable # hide -con = Console(60) |> enable #hide +con = Console(60) # hide +enable(con) #hide import Term: tprintln using Term.TermMarkdown using Markdown diff --git a/docs/src/basics/prompt.md b/docs/src/basics/prompt.md new file mode 100644 index 000000000..e6149837d --- /dev/null +++ b/docs/src/basics/prompt.md @@ -0,0 +1,66 @@ +# Prompt + +Time for a little example of a simple thing you can use `Term.jl` for: asking for some input. Use a `Prompt`, ask a question, get an answer. Simple, but a little extra style. That's what `AbstractPrompt` types are for. There's a few different flavors, which we'll look at in due time, but essentially a prompt is made of a bit of text, the `prompt` that is displayed to the user, and some machinery to capture the user's input and parse it/ validate it. + +For example: + +```@example prompt +using Term.Prompts + +prompt = Prompt("Simple, right?"); +``` + +creates a `Prompt` object and `ask` then prints the propmt and asks for input: +```julia +prompt |> ask +``` +the output should look something like +```@example prompt +print(prompt) # hide +``` + +here we construct a basic `Prompt` and "ask" it: print the message and capture the reply. `ask` returns the answer, which you can do with as you please. A small warning before we carry on: + +!!! warning "Using VSCode" + As you can see [here](https://discourse.julialang.org/t/vscode-errors-with-user-input-readline/75097/4?u=fedeclaudi), `readlines`, which `AbstractPrompts` use to get the user's input, is a bit troublesome in VSCode. In VSCode, after the prompt gets printed you need to enter "space" (hit the space bar) and then enter and **after** that you can enter your actual replies. + +## Prompt flavours +There's a couple more ways you can use prompts like. One is to ensure you get an answer of the correct `Type`, using the immaginatively names `TypePrompt`: + +```@example prompt + +# this only accepts `Int`s +prompt = TypePrompt(Int, "give me a number") # don't forget to |> ask +print(prompt) # hide +``` + + +If your answer can't be converted to the correct type you'll get a `AnswerValidationError`, not good. + + +So, what if you want to get user inputs, but you don't want to handle any crazy input they can provide? Fear not, use `OptionsPrompt` so that only acceptable options will be ok. This will keep "asking" your prompt until the user's answer matches one of the given options + +```@example prompt +prompt = OptionsPrompt(["a lot", "so much", "the most"], "How likely would you be to recomend Term.jl to a friend or colleague?") # don't forget to |> ask +print(prompt) # hide +``` + +Okay, so much typing though. Let's be realistic, most likely you just want to ask a yes/no question and the answer is likely just yes. So just use a `DefaultPrompt`: + +```@example prompt + +# one says the first option is the default +prompt = DefaultPrompt(["yes", "no"], 1, "Confirm?") # don't forget to |> ask +print(prompt) # hide +``` + +still too much typing? You can just use the `confirm` function which is equivalent to asking the prompt shown above. + + +## Style +The style of prompt elements (e.g. the color of the prompt's text or of the options) is defined in `Theme`. You can also pass style information during prompt creation: + +```@example prompt +Prompt("Do you like this color?", "red") |> println +DefaultPrompt(["yes", "no"], 1, "Confirm?", "green", "blue", "red") |> println +``` \ No newline at end of file diff --git a/docs/src/ren/annotation.md b/docs/src/ren/annotation.md new file mode 100644 index 000000000..52fbb1492 --- /dev/null +++ b/docs/src/ren/annotation.md @@ -0,0 +1,43 @@ +# [Annotation](@id AnnotationDocs) + +I could describe what an `Annotation` is, but it's easier to show it: +```@example ann +using Term.Annotations + +Annotation( + "This is the main text to annotate", + "main"=>"by main we mean most important, the rest is annotations", + "annotate"=>"annotations are just extra bits of info" +) +``` + +as you can see, `Panel`s with extra messages are displayed underneath the main bit of text. +Each "annotation" is defined by `Pair`, the first element of the `Pair` is a substring of the +main text indicating what we want to annotate. The second element is used to specify what we +want to annotate it with. + +If you want to assign some `Style` information to each annotation, you can specify that by using a `Tuple{String, String}` as second element of the `Annotation` `Pair`. In this tuple, the first part refers to the annotation message while the second can store style information. + +```@example ann + +Annotation("this has some style", "style"=>("style means color or stuff like bold", "bold red")) +``` + +and of course you can mix your normal `markup` style too: +Annotation("{bold italic}this{/bold italic} has some style", "style"=>("style means {bright_blue}color{/bright_blue} or stuff like {bold}bold{/bold}", "bold red")). + +--- + +`Annotation` objects are `AbstractRenderables`, so you can mix and match them with other things too. +```@example ann +import Term: Panel, highlight_syntax + +code = highlight_syntax("Annotation(\"main text\", \"main\"=>\"most important\")") + +Panel( + Annotation(code, "\"main text\""=>"main message to be annotated", "\"main\"=>\"most important\""=>"annotation"); + padding=(4, 4, 2, 1), + title="Annotation: usage", fit=true, title_style="default green bold", + title_justify=:center, style="green dim" +) +``` diff --git a/docs/src/ren/panel.md b/docs/src/ren/panel.md index bffa31747..8b5cf59c5 100644 --- a/docs/src/ren/panel.md +++ b/docs/src/ren/panel.md @@ -88,17 +88,15 @@ You can justify the panel's content to `:left, :center, :right`! ``` And style the title and subtitle, or the whole background too: ```@example panel -import Term: highlight_syntax, apply_style, do_by_line, fillin - -syntax_with_bg(t) = do_by_line(ln -> apply_style(ln, "on_red"), fillin(t) |> highlight_syntax) +import Term: highlight_syntax Panel( - syntax_with_bg(""" + highlight_syntax(""" function show_off(x) print(x) end """); - background="on_red" + background="on_black", fit=true, style="on_black" ) ``` diff --git a/docs/src/ren/tree.md b/docs/src/ren/tree.md index 68550e0ce..653bb70cd 100644 --- a/docs/src/ren/tree.md +++ b/docs/src/ren/tree.md @@ -19,7 +19,6 @@ As you can see, the starting point is a `Dict` with `key -> value` entries which If you have nested data, just create nested dictionaries! ```@example tree - data = Dict( "a" => 1, "b" => Int64, @@ -32,41 +31,81 @@ data = Dict( print(Tree(data)) ``` -Easy! [`Tree`](@ref) has lots of options to allow you to style it as you like: +Under the hood, `Tree` just leverages [AbstractTrees.jl](https://github.com/JuliaCollections/AbstractTrees.jl) to handle tree-like data structues, so anything that is compatible with that framework will printed as a `Tree`. + ```@example tree -print( - Tree(data, - title="my custom tree", - title_style="red", - guides_style="green", - guides_type=:boldtree - - ) -) +# expressions +Tree(:(print, (:x, :(y+1)))) |> print + +# arrays +Tree([1, [1, 2, [:a, :b, :c]]]) |> print + +# and more! ``` -And of course trees behave just like any renderable so you can create layouts with them: -```@example -import Term: Panel, Tree +Essentially `Tree` work's with `AbstractTrees` to just produce stylized output. + +!!! tip `Tree` is not a *tree* + `Tree` is an `AbstractRenderable`, it is **not** a datastructure for handling tree-like data. It's only meant to be used to *display* trees in your terminal. As such you can't do operations like finding children of nodes or getting a subtree etc. All of that should be done with `AbstractTrees` and `Tree` is only there to display the output + + +As per the note above, `Tree` is a `AbstractRenderable` type so it playes well with other renderables in term. + +```@example tree +import Term: Panel + data = Dict( "a" => 1, "b" => Int64, - "deep" => Dict( - "x" => 1, - "y" => :x - ), + "c" => (1, 2, 3), +) + +_tree = Tree(data) +_info = Panel("This is a panel\nYou can use it to explain\nwhat the contents of the\ntree are!"; width=30, height=_tree.measure.h, subtitle="description") + +print(_tree * " " *_info) + +``` + +### Styling +Easy! [`Tree`](@ref) has lots of options to allow you to style it as you like. +The style is set by the [`Theme`](@ref ThemeDocs). + +```@example tree +import Term: Theme + +# create a new theme editing the tree style +theme = Theme( + tree_mid = blue, + tree_terminator = blue, + tree_skip = blue, + tree_dash = blue, + tree_trunc = blue, + tree_pair = red_light, + tree_keys = yellow, + tree_max_leaf_width = 22, ) -tree = Tree(data) +print( + Tree(data, + theme=theme + ) +) +``` +`tree_max_leaf_width` sets the max width of the display of each leaf while the other values set the color of different elements of the `Tree`. In particular `mid`, `terminator`, `dash` refer to the lines (or guides) of the tree. +And since we're talking about `guides` you can also use different ones +```@example tree print( - ("\n" / tree) * " " * Panel(tree; fit=true) + Tree(data, + guides=:asciitree + ) ) ``` -!!! tip "Entries order" - Used `OrderedCollections.OrderedDict` instead of `Dict` if you want to specify the order of entries in the `Tree`. +there's a couple named guides style, but you can customize things even further using an `AbstractTree.TreeCharSet` if you wish. + ## TypeTree As you know, Julia allows for hierarchical types structures. Trees are for visualizing hierarchical data structures. So... diff --git a/examples/annotations.jl b/examples/annotations.jl new file mode 100644 index 000000000..3a2444331 --- /dev/null +++ b/examples/annotations.jl @@ -0,0 +1,26 @@ +using Term +using Term.Annotations +import Term: highlight_syntax, TERM_THEME + +Annotation( + highlight_syntax("Panel(content; fit=true)"), + "Panel" => ("this is the struct constructor call", TERM_THEME[].func), + "content" => ("here you put what goes inside the panel", "white"), + "fit=true" => ( + "Setting this as `true` adjusts the panel's width to fit `content`. Otherwise `Panel` will have a fixed width", + "bright_blue", + ), +) |> print + +txt = """Annotation("main text", "this"=>"annotation: extra info", "main text"=>("with style", "green"))""" +ex = "\"to annotate\"=>(\"annotation message\", \"red\")" +ann = Annotation( + highlight_syntax(txt), + "Annotation" => ("contructor", TERM_THEME[].func), + "main text" => "text to be annotated.\nSubstrings of this will be annotated with extra info.", + "\"this\"=>\"annotation: extra info\"" => "simple annotation, no style. Just passed as a `Pair`", + """"main text"=>("with style", "green"))""" => ( + "{white}annotation with extra style info: use a {red}`Tuple` to specify both the annotation's{/red} message and additional style info.{/white} For example:\n\n $(highlight_syntax(ex))", + "bright_green", + ), +) diff --git a/examples/errors.jl b/examples/errors.jl index 661447201..7fabb697b 100644 --- a/examples/errors.jl +++ b/examples/errors.jl @@ -16,7 +16,7 @@ error information. import Term: install_term_stacktrace, hLine install_term_stacktrace() - +install_term_logger() print(hLine("Fancy Errors"; style = "bold blue")) """ @@ -29,7 +29,7 @@ corresponding error message """ # ------------ MethodError -1 - "a" +# 1 - "a" # ------------ DomainError # sqrt(-1) @@ -63,19 +63,19 @@ corresponding error message # my_func() # ------------ DimensionMismatch -# m = zeros(20, 20) -# n = zeros(5, 4) -# m .+ n +m = zeros(20, 20) +n = zeros(5, 4) +m .+ n # ------------ Errors with type creation -# struct MyType -# x::Int -# y -# z::String -# end +struct MyType + x::Int + y + z::String +end -# MyType(x::Int, y::Int) = MyType(x, y, "" + string(1 + "o")) -# MyType(x::Int) = MyType(x, 0) +MyType(x::Int, y::Int) = MyType(x, y, 1) +MyType(x::Int) = MyType(x, 0) -# MyType(1) +MyType(1) diff --git a/examples/layout.jl b/examples/layout.jl index 5f596418f..8b749e744 100644 --- a/examples/layout.jl +++ b/examples/layout.jl @@ -26,7 +26,7 @@ println(s1 * " " * s2) println(s1 / s2) # with panels (and text boxes) -p1 = Panel("content {blue}content{/blue} "^10; fit = false, width = 40) +p1 = Panel("content {blue}content{/blue} "^10; fit = false, width = 30) tb1 = TextBox("this is a text boox! "^5; width = 66) println(p1 * tb1) diff --git a/examples/tables.jl b/examples/tables.jl index c66551280..5daa68702 100644 --- a/examples/tables.jl +++ b/examples/tables.jl @@ -2,6 +2,8 @@ using Term import Term.Tables: Table import Term.Layout: PlaceHolder +install_term_stacktrace() + """ This is an example showing how to create tables in Term.jl diff --git a/examples/tree.jl b/examples/tree.jl index ab7f42953..e1ba6ad8f 100644 --- a/examples/tree.jl +++ b/examples/tree.jl @@ -6,9 +6,9 @@ The easiest starting point is a `Dict` object with the info we want to show in the tree """ -import Term: Tree +import Term: Tree, Theme -data = Dict("a" => 1, "b" => Int64, "c" => [1, 2, 3]) +data = Dict("a" => 1, "b" => Int64, "c" => [1, 2, 3], "d" => "a b c"^5) print(Tree(data)) @@ -17,22 +17,23 @@ print(Tree(data)) """ print("\n\n") -for guides_type in (:standardtree, :boldtree, :asciitree) - print(Tree(data; title = string(guides_type), guides_type = guides_type)) +for guides in (:standardtree, :boldtree, :asciitree) + Tree(data; guides = guides) |> print end # set the colors! print("\n\n") -print( - Tree( - data; - title = "my colors", - title_style = "bold red", - node_style = "blue underline", - leaf_style = "green", - guides_style = "red dim", - ), +theme = Theme( + tree_mid = "green", + tree_terminator = "green", + tree_skip = "green", + tree_dash = "green", + tree_trunc = "green", + tree_pair = "red", + tree_keys = "blue", + tree_max_leaf_width = 44, ) +print(Tree(data; theme = theme)) """ Tree can handle nested data too! diff --git a/logo.png b/logo.png deleted file mode 100644 index e6c46e637..000000000 Binary files a/logo.png and /dev/null differ diff --git a/scripts/inspector_gadget.jl b/scripts/inspector_gadget.jl new file mode 100644 index 000000000..29be1875a --- /dev/null +++ b/scripts/inspector_gadget.jl @@ -0,0 +1,6 @@ +modules(m::Module) = ccall(:jl_module_usings, Any, (Any,), m) + +""" +Write some function to define all functions and types in a module an submodules. + And a "search" function +""" diff --git a/scripts/panel.jl b/scripts/panel.jl index 2f715c790..834c79093 100644 --- a/scripts/panel.jl +++ b/scripts/panel.jl @@ -7,7 +7,7 @@ clear() pprint(pan) = begin print(" " * hLine(pan.measure.w; style = "red")) - print(vLine(pan.measure.h + 1; style = "red") * pan) + print(vLine(pan.measure.h; style = "red") * pan) println(pan.measure, " ", length(pan.segments)) # print(pan) end diff --git a/scripts/precompilation_test.jl b/scripts/precompilation_test.jl new file mode 100644 index 000000000..34a567577 --- /dev/null +++ b/scripts/precompilation_test.jl @@ -0,0 +1,29 @@ +print("\n\n\n\n") + +using Term + +txt = join( + repeat(["this is a random {red}text{/red} to test {bold}precompilation"], 10), + "\n", +) + +runnable = quote + originalSTDOUT = stdout + (outRead, outWrite) = redirect_stdout() + + Panel(txt; fit = false, width = 25) |> tprint + close(outRead) + redirect_stdout(originalSTDOUT) +end + +println("\n\nFIRST RUN") +tstart = time(); +eval(runnable); +tend = time(); +tend - tstart |> println + +println("\nSECOND RUN") +tstart = time(); +eval(runnable); +tend = time(); +tend - tstart |> println diff --git a/src/Term.jl b/src/Term.jl index 6431f667f..67b5b1392 100644 --- a/src/Term.jl +++ b/src/Term.jl @@ -18,7 +18,7 @@ less(term_demo) # see demo code # Example -```jldoctest +``` julia begin println(@green "this is green") println(@blue "and this is blue") @@ -32,20 +32,24 @@ module Term using Unicode +const STACKTRACE_HIDDEN_MODULES = Ref(String[]) +const STACKTRACE_HIDE_FRAMES = Ref(true) + const DEBUG_ON = Ref(false) const ACTIVE_CONSOLE_WIDTH = Ref{Union{Nothing,Int}}(nothing) const ACTIVE_CONSOLE_HEIGHT = Ref{Union{Nothing,Int}}(nothing) -default_width(io = stdout) = min(88, something(ACTIVE_CONSOLE_WIDTH[], displaysize(io)[2])) -default_stacktrace_width(io = stderr) = +default_width(io = stdout)::Int = + min(88, something(ACTIVE_CONSOLE_WIDTH[], displaysize(io)[2])) +default_stacktrace_width(io = stderr)::Int = min(140, something(ACTIVE_CONSOLE_WIDTH[], displaysize(io)[2])) const DEFAULT_ASPECT_RATIO = Ref(4 / 3) # 4:3 - 16:9 - 21:9 # general utils -include("__text_utils.jl") include("_ansi.jl") +include("__text_utils.jl") include("_utils.jl") include("_text_reshape.jl") @@ -57,18 +61,23 @@ include("highlight.jl") const TERM_THEME = Ref(Theme()) +# used to disable links in stacktraces for testing +const TERM_SHOW_LINK_IN_STACKTRACE = Ref(true) + function update! end # rely on other modules include("style.jl") include("segments.jl") include("macros.jl") +include("_code.jl") # renderables, rely heavily on other modules include("boxes.jl") include("console.jl") include("renderables.jl") include("layout.jl") +include("link.jl") include("panels.jl") include("errors.jl") include("tprint.jl") @@ -82,6 +91,8 @@ include("repr.jl") include("compositors.jl") include("grid.jl") include("introspection.jl") +include("prompt.jl") +include("annotations.jl") export RenderableText, Panel, TextBox, @nested_panels @@ -93,7 +104,7 @@ export install_term_stacktrace, install_term_logger, uninstall_term_logger, install_term_repr export vLine, hLine export @with_repr, termshow, @showme -export Compositor, update! +export Compositor export grid export inspect @@ -117,6 +128,8 @@ using .Renderables: AbstractRenderable, Renderable, RenderableText using .Layout +using .Links + using .Panels: Panel, TextBox, @nested_panels # define additional methods for measure functions @@ -147,7 +160,7 @@ Measures.Measure(segments::AbstractVector) = end # ---------------------------------- others ---------------------------------- # -using .Errors: install_term_stacktrace +using .Errors: install_term_stacktrace, render_backtrace, StacktraceContext using .Logs: install_term_logger, uninstall_term_logger, TermLogger @@ -163,7 +176,7 @@ using .Introspection: inspect, typestree, expressiontree, inspect using .Tables: Table -using .Compositors: Compositor, update! +using .Compositors: Compositor using .TermMarkdown: parse_md @@ -171,24 +184,7 @@ using .Repr: @with_repr, termshow, install_term_repr, @showme using .Grid -using SnoopPrecompile - -@precompile_setup begin - originalSTDOUT = stdout +using .Prompts - (outRead, outWrite) = redirect_stdout() - - @precompile_all_calls begin - Panel() - Panel("test") * Panel(Panel()) / hLine(20) |> tprint - termshow(Panel) - termshow(Dict(:x => 1)) - termshow(zeros(4)) - termshow(zeros(4, 4)) - end - - close(outRead) - - redirect_stdout(originalSTDOUT) -end +include("__precompilation.jl") end diff --git a/src/__precompilation.jl b/src/__precompilation.jl new file mode 100644 index 000000000..e1857118d --- /dev/null +++ b/src/__precompilation.jl @@ -0,0 +1,195 @@ + +# ---------------------------------------------------------------------------- # +# PRECOMPILATION # +# ---------------------------------------------------------------------------- # +using SnoopPrecompile +SnoopPrecompile.verbose[] = false + +@precompile_setup begin + txt = join( + repeat(["this is a random {red}text{/red} to test {bold}precompilation"], 10), + "\n", + ) + + mdtext = md""" + # Markdown rendering in Term.jl + ## two + ### three + #### four + ##### five + ###### six + + This is an example of markdown content rendered in Term.jl. + You can use markdown syntax to make words **bold** and *italic* or insert `literals`. + + + You markdown can include in-line latex ``\LaTeX \frac{{1}}{{2}}`` and maths in a new line too: + + ```math + f(a) = \frac{1}{2\pi}\int_{0}^{2\pi} (\alpha+R\cos(\theta))d\theta + ``` + + You can also have links: [Julia](http://www.julialang.org) and + footnotes [^1] for your content [^named]. + + And, of course, you can show some code too: + + ```julia + function say_hi(x) + print("Hellow World") + end + ``` + + --- + + You can use "quotes" to highlight a section: + + > Multi-line quotes can be helpful to make a + > paragram stand out, so that users won't miss it! + > You can use **other inline syntax** in you `quotes` too. + + but if you really need to grab someone's attention, use admonitions: + + !!! note + You can use different levels + + !!! warning + to send different messages + + !!! danger + to your reader + + !!! tip "Wow!" + Turns out that admonitions can be pretty useful! + What will you use them for? + + --- + + Of course you can have classic lists: + * item one + * item two + * And a sublist: + + sub-item one + + sub-item two + + and ordered lists too: + 1. item one + 2. item two + 3. item three + + + !!! note "Tables" + You can use the [Markdown table syntax](https://www.markdownguide.org/extended-syntax/#tables) + to insert tables - Term.jl will convert them to Table object! + + | Term | handles | tables| + |:---------- | ---------- |:------------:| + | Row `1` | Column `2` | | + | *Row* 2 | **Row** 2 | Column ``3`` | + + + ---- + + This is where you print the content of your foot notes: + + [^1]: Numbered footnote text. + + [^note]: + Named footnote text containing several toplevel elements. + """ + + code = """ +function render( +content::Union{Renderable,RenderableText}; +box::Symbol = TERM_THEME[].box, +style::String = TERM_THEME[].line, +title::Union{String,Nothing} = nothing, +title_style::Union{Nothing,String} = nothing, +Δh::Int, +padding::Padding, +background::Union{Nothing,String} = nothing, +kwargs..., +)::Panel +background = get_bg_color(background) +# @info "calling render" content content_measure background + +# create top/bottom rows with titles +box = BOXES[box] # get box object from symbol +top = get_title_row( + :top, + box; + title_style = title_style, + justify = title_justify, +) + +bottom = get_title_row( + :bottom, + box, + subtitle; + width = panel_measure.w, +) + +# get left/right vertical lines +σ(s) = apply_style("\e[0m{" * style * "}" * s * "{/" * style * "}") +left, right = σ(box.mid.left), σ(box.mid.right) + +# get an empty padding line +empty = if isnothing(background) + [Segment(left * " "^(panel_measure.w - 2) * right)] +else + [Segment(left * "{background}" * " "^(panel_measure.w - 2) * "{/background}" * right)] +end +""" + + junkio = IOBuffer() # from https://github.com/timholy/SnoopCompile.jl/issues/308 + + @precompile_all_calls begin + reshape_text(txt, 10) + print(junkio, Panel()) + tprint(junkio, Panel()) + + print(junkio, Panel(txt; fit = false, justify = :right, width = 25)) + print( + junkio, + Panel( + txt; + fit = true, + title = "test", + subtitle = "test", + style = "red on_blue", + background = "blue", + ), + ) + + r = RenderableText(txt; width = 30, style = "red") + r2 = RenderableText(txt) + p = Panel(txt) + r * p + r / p + + hLine(10) + hLine(100, "test"; style = "red") + vLine() + + tprintln(junkio, mdtext) + + # repr + termshow(junkio, Panel) + termshow(junkio, print) + termshow(junkio, zeros(100)) + termshow(junkio, zeros(100, 100)) + termshow(junkio, zeros(100, 100, 10)) + + # errors + ctx = StacktraceContext() + bt = backtrace() + + render_backtrace(ctx, bt) + render_backtrace(ctx, bt; hide_frames = false) + + code_h = highlight_syntax(code; style = true) + reshape_code_string(code_h, 30) + + load_code_and_highlight("src/panels.jl", 20) + end +end diff --git a/src/__text_utils.jl b/src/__text_utils.jl index 7ee8dafcb..fff7da886 100644 --- a/src/__text_utils.jl +++ b/src/__text_utils.jl @@ -1,7 +1,7 @@ """ multiple strings replacement. """ -function replace_multi(text, pairs...)::String +function replace_multi(text::AbstractString, pairs::Pair...)::String VERSION ≥ v"1.7" && return replace(text, pairs...) VERSION < v"1.7" && begin for pair in pairs @@ -18,13 +18,8 @@ plural(word::AbstractString, n) = n <= 1 ? word : word * 's' # ---------------------------------------------------------------------------- # # ---------------------------------- markup ---------------------------------- # -""" -This regex uses lookahead and lookbehind to exclude {{ -at the beginning of a tag, with this: - (? "", - GENERIC_CLOSER_REGEX => "", - CLOSE_TAG_REGEX => "", -) +function remove_markup(input_text; remove_orphan_tags = true)::String + if remove_orphan_tags + return replace_multi( + input_text, + OPEN_TAG_REGEX => "", + GENERIC_CLOSER_REGEX => "", + CLOSE_TAG_REGEX => "", + ) + else + # turn non-orphaned closing tags in opening tags before removing them + for match in eachmatch(OPEN_TAG_REGEX, input_text) + markup = match.match[2:(end - 1)] + close = r"\{\/" * Regex(markup) * r"\}" + input_text = replace(input_text, close => "{$markup}", count = 1) + end + return replace_multi(input_text, OPEN_TAG_REGEX => "", GENERIC_CLOSER_REGEX => "") + end +end """ has_markup(text::String) @@ -47,70 +54,21 @@ Returns `true` if `text` includes a `MarkupTag` has_markup(text)::Bool = occursin(OPEN_TAG_REGEX, text) # ----------------------------------- ansi ----------------------------------- # -const ANSI_REGEXE = r"\e\[[0-9;]*m" +const ANSI_REGEX = r"\e\[[0-9;]*m" """ remove_ansi(input_text::AbstractString)::AbstractString Remove all ANSI tags from a string of text """ -remove_ansi(input_text)::String = replace(input_text, ANSI_REGEXE => "") +remove_ansi(input_text)::String = replace(input_text, ANSI_REGEX => "") """ has_ansi(text::String) Returns `true` if `text` includes a `MarkupTag` """ -has_ansi(text)::Bool = occursin(ANSI_REGEXE, text) - -""" - get_last_ANSI_code(text)::String - -Get the last ANSI code in a sting, returns "" if no ANSI code found. -""" -function get_last_ANSI_code(text)::String - has_ansi(text) || return "" - - # get the last matching regex - rmatch = collect((eachmatch(ANSI_REGEXE, text)))[end] - return rmatch.match -end - -""" - get_ANSI_codes(text)::String - -Returns a string with all ANSI codes in the input. -""" -function get_ANSI_codes(text)::String - has_ansi(text) || return "" - matches = collect((eachmatch(ANSI_REGEXE, text))) - return *(map(m -> m.match, matches)...) -end - -""" - replace_ansi(input_text) - -Replace ANSI tags with ¦. - -The number of '¦' matches the length of the ANSI tags. -Used when we want to hide ANSI tags but keep the string length intact. -""" -function replace_ansi(input_text) - while occursin(rx, input_text) && (m = match(ANSI_REGEXE, input_text)) !== nothing - input_text = - replace_text(input_text, m.offset - 1, m.offset + length(m.match) - 1, '¦') - end - return input_text -end - -ANSI_CLEANUP_REGEXES = [ - r"\e\[[0-9][0-9]m\e\[39m" => "", - r"\e\[[0-9][0-9]m\e\[49m" => "", - r"\e\[[0-9]m\e\[2[0-9]m" => "", - r"\e\[22m\e\[22m" => "", -] - -cleanup_ansi(text) = replace_multi(text, ANSI_CLEANUP_REGEXES...) +has_ansi(text)::Bool = occursin(ANSI_REGEX, text) # --------------------------- clean text / text len -------------------------- # """ @@ -125,8 +83,8 @@ cleantext(str)::String = (remove_ansi ∘ remove_markup)(str) Get length of text after all style information is removed. """ -textlen(x::String)::Int = (textwidth ∘ remove_markup ∘ remove_ansi)(x) -textlen(x::SubString)::Int = (textwidth ∘ remove_markup ∘ remove_ansi)(x) +textlen(x; remove_orphan_tags = false)::Int = + remove_markup(remove_ansi(x); remove_orphan_tags = remove_orphan_tags) |> textwidth # --------------------------------- brackets --------------------------------- # const brackets_regexes = [r"(? "{{", brackets_regexes[2] => "}}") -const remove_brackets_regexes = [r"\{\{", r"\}\}"] - """ unescape_brackets(text)::String Replece every double squared parenthesis with a single copy of itself """ -unescape_brackets(text)::String = replace_multi( - text, - remove_brackets_regexes[1] => "{", - remove_brackets_regexes[2] => "}", -) +unescape_brackets(text)::String = replace_multi(text, "{{" => "{", "}}" => "}") + +unescape_brackets_with_space(text)::String = replace_multi(text, "{{" => " {", "}}" => "} ") + +# ------------------------------ multiline-style ----------------------------- # +""" + fix_markup_across_lines(lines::Vector{AbstractString})::Vector{AbstractString} -unescape_brackets_with_space(text)::String = replace_multi( - text, - remove_brackets_regexes[1] => " {", - remove_brackets_regexes[2] => "} ", +When splitting text with markup tags across multiple lines, tags can get separated +across lines. This is a problem when the text gets printed side by side with other +text with style information. This fixes that by copying/closing markup tags +across lines as requested. +Essentially, if a tag is opened but not closed in a line, close it at the end of +the line and add the same open tag at the start of the next, taking care of +doing things in the correct order when multiple tags are in the same line. +""" +function fix_markup_across_lines(lines::Vector)::Vector + for (i, ln) in enumerate(lines) + # loop over each open tag regex + for open_match in reverse(collect(eachmatch(OPEN_TAG_REGEX, ln))) + # get closing tag text + markup = open_match.match[2:(end - 1)] + close_tag = "{/$markup}" + + # if there's no close tag, add the open tag to the next line and close it on this + if !occursin(close_tag, ln[(open_match.offset):end]) && !occursin("{/}", ln) + # @info "carrying over" i markup + ln = ln * "{/$markup}" + i < length(lines) && (lines[i + 1] = "{$markup}" * lines[i + 1]) + end + end + lines[i] = ln * "\e[0m" + end + + return lines +end + +""" Check if an ANSI tag is a closer """ +function is_closing_ansi_tag(tag::SubString) + tag ∈ ( + "\e[0m", + "\e[39m", + "\e[49m", + "\e[22m", + "\e[23m", + "\e[24m", + "\e[25m", + "\e[27m", + "\e[28m", + "\e[29m", + ) +end + +ansi_pairs = Dict( + "\e[22m" => "\e[22m", + "\e[1m" => "\e[22m", + "\e[1m" => "\e[22m", + "\e[2m" => "\e[22m", + "\e[3m" => "\e[23m", + "\e[3m" => "\e[23m", + "\e[4m" => "\e[24m", + "\e[4m" => "\e[24m", + "\e[5m" => "\e[25m", + "\e[7m" => "\e[27m", + "\e[8m" => "\e[28m", + "\e[9m" => "\e[29m", ) +""" Given an ANSI tag, get the correct closer tag """ +function get_closing_ansi_tag(tag::SubString) + tag ∈ keys(ansi_pairs) && return ansi_pairs[tag] + + # deal with foreground colors + occursin(r"\e\[3\dm", tag) && return "\e[39m" + occursin(r"\e\[38[0-9;]*m", tag) && return "\e[39m" + + # deal with background colors + occursin(r"\e\[4\dm", tag) && return "\e[49m" + occursin(r"\e\[48[0-9;]*m", tag) && return "\e[49m" + return nothing +end + +""" + +Same as `fix_markup_across_lines` but for ANSI style tags. +""" +function fix_ansi_across_lines(lines::Vector)::Vector + for (i, ln) in enumerate(lines) + for match in reverse(collect(eachmatch(ANSI_REGEX, ln))) + ansi = match.match + is_closing_ansi_tag(ansi) && continue + + # get closing tag + closer = get_closing_ansi_tag(ansi) + + # check if the closing tag occurs in the line + if !occursin(closer, ln[(match.offset):end]) + # if no closing, add closing to end of line and tag to start of next line + ln = ln * closer + i < length(lines) && (lines[i + 1] = ansi * lines[i + 1]) + end + end + lines[i] = ln # * "\e[0m" + end + + return lines +end + # ---------------------------------------------------------------------------- # # I/O # # ---------------------------------------------------------------------------- # @@ -177,12 +229,6 @@ function read_file_lines(path::AbstractString, start::Int, stop::Int) return collect(enumerate(lines))[start:stop] end -function read_file_lines(path::AbstractString, line::Int) - !isfile(path) && return nothing - lines = readlines(path; keep = true) - return collect(enumerate(lines))[line] -end - # ---------------------------------------------------------------------------- # # MISC # # ---------------------------------------------------------------------------- # @@ -192,7 +238,6 @@ end Get a view object with appropriate indices """ tview(text, start::Int, stop::Int) = view(text, thisind(text, start):thisind(text, stop)) -tview(text, start::Int, stop::Int, simple::Symbol) = view(text, start:stop) """ replace_text(text::AbstractString, start::Int, stop::Int, replace::AbstractString) @@ -248,20 +293,6 @@ function rtrim_str(str, width) return str[edge:end] end -""" - nospaces(text::AbstractString) - -Remove all spaces from a string. -""" -nospaces(text::AbstractString) = replace(text, " " => "") - -""" - remove_brackets(text::AbstractString) - -Remove all () brackets from a string. -""" -remove_brackets(text)::String = replace_multi(text, "(" => "", ")" => "") - """ unspace_commas(text::AbstractString) @@ -280,8 +311,6 @@ chars(text::AbstractString)::Vector{Char} = collect(text) Merge a vector of strings in a single string. """ join_lines(lines::Vector{String})::String = join(lines, "\n") -join_lines(lines::Vector)::String = join(lines, "\n") -join_lines(lines...) = join(lines, "\n") """ split_lines(text::AbstractString) @@ -298,15 +327,7 @@ Apply `fn` to each line in the `text`. The function `fn` should accept a single `::String` argument. """ -function do_by_line(fn::Function, text)::String - out = "" - for (last, line) in loop_last(split_lines(text)) - out *= fn(line) * (last ? "" : "\n") - end - return out -end - -do_by_line(fn::Function, text::Vector)::String = join_lines(fn.(text)) +do_by_line(fn::Function, text::AbstractString)::String = join(fn.(split_lines(text)), "\n") # ------------------------------- reshape text ------------------------------- # """ @@ -360,3 +381,29 @@ function str_trunc( out[end] != ' ' && (out *= trailing_dots) return out end + +# ---------------------------------------------------------------------------- # +# LINK # +# ---------------------------------------------------------------------------- # + +""" + excise_link_display_text(link::String) + +Given a link string of the form: + "\x1b]8;;LINK_DESTINATION\x1b\\LINK_DISPLAY_TEXT\x1b]8;;\x1b\\" +this function returns "LINK_DISPLAY_TEXT" alone. +""" +function excise_link_display_text(link::AbstractString) + parts = split(link, "\x1b\\") + return if length(parts) > 1 + replace(parts[2], "\e]8;;" => "") + else + "" + end +end + +""" + string_type(x) +Return the type of `x` if it's an AbstractString, else String +""" +string_type(x) = x isa AbstractString ? typeof(x) : String diff --git a/src/_code.jl b/src/_code.jl new file mode 100644 index 000000000..f3c58fdc7 --- /dev/null +++ b/src/_code.jl @@ -0,0 +1,11 @@ +""" +Reshaping strings with Julia code requires particular care +""" +function reshape_code_string(code, width::Int) + # highlight syntax + code = apply_style(highlight(code; ignore_ansi = false); leave_orphan_tags = true) + + # reshape + code = reshape_text(code, width; ignore_markup = true) + return code +end diff --git a/src/_compositor.jl b/src/_compositor.jl index cf1324d51..620376f2e 100644 --- a/src/_compositor.jl +++ b/src/_compositor.jl @@ -80,8 +80,6 @@ function collect_elements(ex::Expr) end end -clean_layout_symbol(s::Symbol) = s[1] ∉ layout_symbols ? s[1] : s - function clean_layout_expr(ex::Expr) if ex.args[1] ∉ layout_symbols return ex.args[1] diff --git a/src/_errors.jl b/src/_errors.jl index 6d58ffc9c..a6990493e 100644 --- a/src/_errors.jl +++ b/src/_errors.jl @@ -2,218 +2,280 @@ import Base.StackTraces: StackFrame import MyterialColors: pink, indigo_light import Term: read_file_lines +# ---------------------------------------------------------------------------- # +# MISC # +# ---------------------------------------------------------------------------- # + +function get_frame_file(frame::StackFrame) + file = string(frame.file) + file = Base.fixup_stdlib_path(file) + Base.stacktrace_expand_basepaths() && + (file = something(Base.find_source_file(file), file)) + Base.stacktrace_contract_userdir() && (file = Base.contractuser(file)) + + return if isnothing(file) + "" + else + basename(file) + end +end """ - show_error_code_line(frame::StackFrame; δ=2) + function frame_module end -Create a `Panel` showing formatted Julia code for a frame's error line. -The parameter `δ` speciies how many lines above/below the error line to show. -When δ = 0 only the error line is shown and the panel's style is altered +Get the Module a function is defined in, as a string """ -function show_error_code_line(frame::StackFrame; δ = 2) - theme = TERM_THEME[] - error_source = nothing - try - error_source = load_code_and_highlight(string(frame.file), Int(frame.line); δ = δ) - catch - error_source = nothing +function frame_module(frame::StackFrame)::Union{Nothing,String} + m = Base.parentmodule(frame) + + if m !== nothing + while parentmodule(m) !== m + pm = parentmodule(m) + pm == Main && break + m = pm + end end + m = !isnothing(m) ? string(m) : frame_module(string(frame.file)) - (isnothing(error_source) || length(error_source) == 0) && return nothing + isnothing(m) && return frame_module(get_frame_file(frame)) + return m +end - _width = min(60, default_stacktrace_width() - 6) - code_error_panel = Panel( - str_trunc(error_source, _width - 5; ignore_markup = true); - fit = δ == 0, - style = δ > 0 ? "$(theme.text_accent) dim" : "dim", - width = _width, - subtitle_justify = :center, - subtitle = δ > 0 ? "error line" : nothing, - subtitle_style = "default $(theme.text_accent)", - height = δ > 0 ? nothing : 1, - padding = δ == 0 ? (0, 1, 0, 0) : (2, 2, 0, 0), - # background = δ > 0 ? nothing : theme.md_codeblock_bg - ) +""" +Get module from file path. +""" +frame_module(path::String) = startswith(path, "./") ? "Base" : nothing + +""" +Get module for a pointer obj +""" +frame_module(pointer::Ptr) = frame_module(StackTraces.lookup(pointer)[1]) +frame_module(iip::Base.InterpreterIP) = string(iip.mod) - code_error_panel = " " * RenderableText("│\n╰─"; style = "dim") * code_error_panel +""" + should_skip - return code_error_panel +A frame should skip if it's in Base or an installed package. +""" +function should_skip(frame::StackFrame, modul) + mod = something(modul, frame) + f = get_frame_file(frame) + + bad = mod ∈ ["Base", "Main", nothing, "VSCodeServer", "REPL"] + bad = bad || mod ∈ STACKTRACE_HIDDEN_MODULES[] + + return bad || ( + contains(f, r"[/\\].julia[/\\]") || + contains(f, r"julia[/\\]stdlib") || + contains(f, r"julia[/\\]lib") || + contains(f, "julialang.language") || + contains(f, "libjulia") + ) end +should_skip(frame::StackFrame, hide::Bool, args...) = + hide ? should_skip(frame, args...) : false +should_skip(pointer::Ptr, args...) = should_skip(StackTraces.lookup(pointer)[1], args...) +should_skip(pointer::Ptr, hide::Bool, args...) = + hide ? should_skip(pointer, args...) : false +should_skip(iip::Base.InterpreterIP, args...) = true +should_skip(iip::Base.InterpreterIP, hide::Bool, args...) = true """ parse_kw_func_name(frame::StackFrame) -Kw function calls have a weird name, just show the func definition line. +Kw function calls have a weird name, parse arguments to get +a proper function signature. """ -function parse_kw_func_name(frame::StackFrame) - def = frame.linfo.def +function parse_kw_func_name(frame::StackFrame)::String + linfo = frame.linfo + def = linfo.def + + if isa(def, Method) + sig = linfo.specTypes + argnames = Base.method_argnames(def) + ftypes = map(i -> fieldtype(sig, i), 1:length(argnames)) |> collect + + kwargs = map( + i -> fieldname(ftypes[2], i) => fieldtype(ftypes[2], 1), + 1:length(fieldnames(ftypes[2])), + ) - out = read_file_lines(string(def.file), Int(def.line)) - return if !isnothing(out) - replace(out[2], "function" => "") |> rstrip |> lstrip + # get function name and name/type of args and kwargs + func = replace(string(def.name), "##kw" => "") * "(" + func *= join( + map(i -> string(argnames[i]) * "::" * string(ftypes[i]), 4:length(ftypes)), + ", ", + ) + !isempty(kwargs) && begin + func *= "; " * join(["$k::$v" for (k, v) in kwargs], ", ") + end + func *= ")" else - string(sprint(StackTraces.show_spec_linfo, frame)) + func = string(sprint(StackTraces.show_spec_linfo, frame)) end + return func end """ - function render_frame_info end + get_frame_function_name -Create a Term visualization of info and metadata about a -stacktrace frame. +Get and stylize a function's name/signature """ -function render_frame_info end - -function render_frame_info(pointer::Ptr{Nothing}, args...; show_source = true, kwargs...) - frame = StackTraces.lookup(pointer)[1] - return render_frame_info(frame, args...; show_source = show_source, kwargs...) -end - -function render_frame_info(frame::StackFrame; show_source = true, kwargs...) - theme = TERM_THEME[] - +function get_frame_function_name(frame::StackFrame, ctx::StacktraceContext) # get the name of the error function func = sprint(StackTraces.show_spec_linfo, frame) - contains(func, "##kw") && (func = parse_kw_func_name(frame)) + try + (contains(func, "##kw") || contains(func, "kwerr")) && + (func = parse_kw_func_name(frame)) + catch + end # format function name func = replace( func, - r"(?^[^(]+)" => - SubstitutionString("{$(theme.func)}" * s"\g<0>" * "{/$(theme.func)}"), + r"(?^[^(]+)" => SubstitutionString( + "{$(ctx.theme.func)}" * s"\g<0>" * "{/$(ctx.theme.func)}", + ), ) - func = reshape_text(func, default_stacktrace_width() - 6) |> lstrip - func = highlight(func) - # get other information about the function - inline = - frame.inlined ? RenderableText(" inlined"; style = "bold dim $(theme.text)") : "" - c = frame.from_c ? RenderableText(" from C"; style = "bold dim $(theme.text)") : "" - func_line = hstack(func, inline, c; pad = 1) - - # load source code around error and render it - file = Base.fixup_stdlib_path(string(frame.file)) - if length(string(frame.file)) > 0 - file_line = RenderableText( - "{dim}$(file):{bold $(theme.text_accent)}$(frame.line){/bold $(theme.text_accent)}{/dim}"; - width = default_stacktrace_width() - 30, - ) + return RenderableText(reshape_code_string(func, ctx.func_name_w)) +end - out = func_line / file_line - if show_source - error_source = show_error_code_line(frame; kwargs...) - isnothing(error_source) || (out /= error_source) - end - return out - else - return RenderableText(func; width = default_stacktrace_width() - 30) +# ---------------------------------------------------------------------------- # +# render source code # +# ---------------------------------------------------------------------------- # + +""" + render_error_code_line(frame::StackFrame; δ=2) + +Create a `Panel` showing formatted Julia code for a frame's error line. +The parameter `δ` speciies how many lines above/below the error line to show. +""" +function render_error_code_line(ctx::StacktraceContext, frame::StackFrame; δ = 2) + # get code as string + error_source = nothing + try + error_source = load_code_and_highlight(string(frame.file), Int(frame.line); δ = δ) + catch + error_source = nothing end + (isnothing(error_source) || length(error_source) == 0) && return nothing + + code_error_panel = Panel( + str_trunc(apply_style(error_source), ctx.code_w - 4; ignore_markup = true); + fit = δ == 0, + style = δ > 0 ? "$(ctx.theme.text_accent) dim" : "dim", + width = ctx.code_w, + subtitle_justify = :center, + subtitle = δ > 0 ? "error line" : nothing, + subtitle_style = "default $(ctx.theme.text_accent)", + height = δ > 0 ? nothing : 1, + padding = (0, 1, 0, 0), + ) + return " " * RenderableText("│\n╰─"; style = "dim") * (code_error_panel) end """ - render_backtrace_frame( - num::RenderableText, - info::AbstractRenderable; - as_panel = true, - kwargs..., - ) + function add_stack_frame! end -Render a backtrace frame as either a `Panel` or a `RenderableText` +Create a Term visualization of info and metadata about a +stacktrace frame. +""" +function add_stack_frame! end + +""" + add_stack_frame!(frame::StackFrame, ctx::StacktraceContext, num::Int; kwargs...) + +Renders a panel with: + - frame number + - function name/signature + - source code at error line """ -function render_backtrace_frame( - num::RenderableText, - info::AbstractRenderable, - ; - as_panel = true, +function add_stack_frame!( + content, + frame::StackFrame, + ctx::StacktraceContext, + as_panel::Bool, + num::Int; + δ = 3, kwargs..., ) - content = hstack(num, info, pad = 1) - return if as_panel + # get the name of the error function + func = get_frame_function_name(frame, ctx) + + # get other information about the function + inline = + frame.inlined ? RenderableText("inlined"; style = "bold dim $(ctx.theme.text)") : "" + c = frame.from_c ? RenderableText("from C"; style = "bold dim $(ctx.theme.text)") : "" + + # make function line + func_line = (frame.inlined || frame.from_c) ? func / hstack(inline, c; pad = 1) : func + + # make file line & load source code around error and render it + panel_content = if length(string(frame.file)) > 0 + # get a link renderable pointing to error + if TERM_SHOW_LINK_IN_STACKTRACE[] == true + source_file = Link(string(frame.file), frame.line; style = "underline dim") + _out = func_line / source_file + else + _out = func_line + end + error_source = render_error_code_line(ctx, frame; δ = δ) + isnothing(error_source) || (_out /= error_source) + _out + else + func_line + end + + # make panel and add it to content + panel = if as_panel Panel( - content; - padding = (2, 2, 1, 1), - style = TERM_THEME[].err_btframe_panel, + panel_content; + title_style = "$(ctx.theme.err_btframe_panel) bold", + padding = (2, 2, 0, 0), fit = false, - width = default_stacktrace_width() - 6, + width = ctx.frame_panel_w, kwargs..., ) else - " " * RenderableText(string(content), width = default_stacktrace_width() - 20) - end -end - -""" - function frame_module end - -Get the Module a function is defined in, as a string -""" -function frame_module(frame::StackFrame)::Union{Nothing,String} - m = Base.parentmodule(frame) - - if m !== nothing - while parentmodule(m) !== m - pm = parentmodule(m) - pm == Main && break - m = pm - end + pad(" " * panel_content; width = ctx.frame_panel_w, method = :right) end - m = !isnothing(m) ? string(m) : frame_module(string(frame.file)) - return m + numren = vertical_pad("{dim}($num){/dim} ", height(panel), :center) + push!(content, numren * panel) end -""" -Get module from file path. -""" -frame_module(path::String) = startswith(path, "./") ? "Base" : nothing +add_stack_frame!(content, pointer::Ptr{Nothing}, args...; δ = 3, kwargs...) = + add_stack_frame!(content, StackTraces.lookup(pointer)[1], args...; δ = δ, kwargs...) -""" -Get module for a pointer obj -""" -frame_module(pointer::Ptr) = frame_module(StackTraces.lookup(pointer)[1]) +add_stack_frame!(content, pointer::Base.InterpreterIP, args...; δ = 3, kwargs...) = + RenderableText("pointer") """ - should_skip - -A frame should skip if it's in Base or an installed package. -""" -should_skip(frame::StackFrame) = - frame_module(frame) == "Base" || ( - contains(string(frame.file), r"[/\\].julia[/\\]") || - contains(string(frame.file), r"[/\\]julia[/\\]stdlib[/\\]") || - contains(string(frame.file), r"[/\\]julia[/\\]lib[/\\]") - ) - -should_skip(frame::StackFrame, hide::Bool) = hide ? should_skip(frame) : false -should_skip(pointer::Ptr) = should_skip(StackTraces.lookup(pointer)[1]) -should_skip(pointer::Ptr, hide::Bool) = hide ? should_skip(pointer) : false - -""" - add_new_module_name!(content, curr_modul) + add_new_module_name!(content, ctx::StacktraceContext, curr_modul) When a frame belonging to a module different from the previous one is shown, print the new module's name. """ -function add_new_module_name!(content, curr_module) - theme = TERM_THEME[] - accent = theme.err_accent +function add_new_module_name!(content, ctx::StacktraceContext, curr_module) push!( content, hLine( - default_stacktrace_width() - 6, - "{default $(theme.text_accent)}In module {$accent bold}$(curr_module){/$accent bold}{/default $(theme.text_accent)}"; - style = "$accent dim", + ctx.module_line_w, + "{default $(ctx.theme.text_accent)}In module {$(ctx.theme.err_accent) bold}$(curr_module){/$(ctx.theme.err_accent) bold}{/default $(ctx.theme.text_accent)}"; + style = "$(ctx.theme.err_accent) dim", ), ) end """ - add_number_frames_skipped!(content, to_skip, num, bt, n_skipped, skipped_frames_modules) + add_number_frames_skipped!(content, ctx, to_skip, num, bt, n_skipped, skipped_frames_modules) Add some text explaining how many frames were skipped from the stacktrace visualization and to which modules they belonged. """ function add_number_frames_skipped!( content, + ctx::StacktraceContext, to_skip, num, bt, @@ -221,24 +283,27 @@ function add_number_frames_skipped!( skipped_frames_modules, ) if (to_skip == false || num == length(bt) - 1) && n_skipped > 0 - color = TERM_THEME[].err_btframe_panel - accent = TERM_THEME[].err_accent - modules = join(unique(string.(filter(!isnothing, skipped_frames_modules))), ", ") + color = ctx.theme.err_btframe_panel + accent = ctx.theme.err_accent + # get the name of the modules + modules = join(unique(string.(filter(!isnothing, skipped_frames_modules))), ", ") modules = filter(x -> x != "nothing", modules) in_mod = length(modules) == 0 ? "" : "in {$accent}$modules{/$accent}" - word = plural("frame", length(modules)) + word = n_skipped > 1 ? "frames" : "frame" + + # render push!( content, cvstack( - hLine(default_stacktrace_width() - 12; style = "$color dim"), + hLine(ctx.module_line_w; style = "$color dim"), RenderableText( "Skipped {bold}$n_skipped{/bold} $word $in_mod"; - width = default_stacktrace_width() - 6, + width = ctx.frame_panel_w, justify = :center, style = color, ), - hLine(default_stacktrace_width() - 12; style = "$color dim"); + hLine(ctx.module_line_w; style = "$color dim"); pad = 0, ), ) @@ -253,14 +318,13 @@ It renders each frame in a stacktrace after some filtering (e.g. to hide frames It takes care of hiding frames when there's a large number of them. """ function render_backtrace( + ctx::StacktraceContext, bt::Vector; reverse_backtrace = true, max_n_frames = 30, hide_frames = true, ) - theme = TERM_THEME[] length(bt) == 0 && return RenderableText("") - if reverse_backtrace bt = reverse(bt) end @@ -268,79 +332,79 @@ function render_backtrace( # get the module each frame's code line is defined in frames_modules = frame_module.(bt) - # render each frame - content = AbstractRenderable[] + """ + Define a few variables to keep track of during stack + trace rendering. These are used when some frames are hidden + to keep track of how many and in which module they were, + and to know when to print a message to indicate that + the stack trace entered a new module. + """ + added_skipped_message = false N = length(bt) prev_frame_module = nothing # keep track of the previous' frame module n_skipped = 0 # keep track of number of frames skipped (e.g in Base) skipped_frames_modules = [] tot_frames_added = 0 - for (num, frame) in enumerate(bt) - numren = RenderableText("($(num))"; style = "$(theme.emphasis) bold dim") - δ = num in (1, length(bt)) ? 2 : 0 - info = render_frame_info( - frame; - show_source = !should_skip(frame) || num in (1, length(bt)), - δ = δ, - ) + # render each frame + content = AbstractRenderable[] + curr_module = nothing + for (num, frame) in enumerate(bt) # if the current frame's module differs from the previous one, show module name - curr_module = frames_modules[num] - ( - curr_module != prev_frame_module && - !should_skip(frame, hide_frames) && - !isnothing(curr_module) - ) && add_new_module_name!(content, curr_module) - - if num == 1 # first frame is highlighted - push!( - content, - render_backtrace_frame( - numren, - info; - subtitle = reverse_backtrace ? "TOP LEVEL" : "ERROR LINE", - subtitle_style = reverse_backtrace ? "$(theme.text_accent)" : - "bold $(theme.text_accent)", - subtitle_justify = :right, - ), + curr_module = + (num > 1 && !isnothing(curr_module)) ? + something(frames_modules[num], curr_module) : frames_modules[num] + + # get params for rendering + frame_panel_kwargs = if num == 1 # first frame is highlighted + Dict( + :subtitle => reverse_backtrace ? "TOP LEVEL" : "ERROR LINE", + :subtitle_style => + reverse_backtrace ? "$(ctx.theme.text_accent)" : + "bold $(ctx.theme.text_accent)", + :subtitle_justify => :right, + :style => ctx.theme.err_btframe_panel, ) - tot_frames_added += 1 - elseif num == length(bt) # last frame is highlighted - push!( - content, - render_backtrace_frame( - numren, - info; - subtitle = reverse_backtrace ? "ERROR LINE" : "TOP LEVEL", - subtitle_style = reverse_backtrace ? "bold $(theme.text_accent)" : - "$(theme.text_accent)", - subtitle_justify = :right, - ), + Dict( + :subtitle => reverse_backtrace ? "ERROR LINE" : "TOP LEVEL", + :subtitle_style => + reverse_backtrace ? "bold $(ctx.theme.text_accent)" : + "$(ctx.theme.text_accent)", + :subtitle_justify => :right, + :style => ctx.theme.err_btframe_panel, ) - tot_frames_added += 1 else # inside frames are printed without an additional panel around - # skip extra panels for long stack traces - if tot_frames_added > max_n_frames && num < length(bt) - 5 - if added_skipped_message == false - skipped_line = hLine( - content[1].measure.w, - "{bold dim}$(N - max_n_frames - 2){/bold dim}{$(theme.err_btframe_panel) dim} frames skipped{/$(theme.err_btframe_panel) dim}"; - style = "$(theme.err_btframe_panel) dim", - ) - push!(content, skipped_line) - added_skipped_message = true - end - else # show "inner" frames without additional info, hide base optionally - # skip frames in modules like Base - to_skip = should_skip(frame, hide_frames) + Dict(:style => "hidden") + end + δ = num in (1, length(bt)) ? 2 : 0 + to_skip = + should_skip(frame, hide_frames, curr_module) && + num ∉ [1, length(bt)] && + STACKTRACE_HIDE_FRAMES[] + # keep track of frames being skipped + if num ∉ [1, length(bt)] + # skip extra panels for long stack traces + if tot_frames_added > max_n_frames && + num < length(bt) - 5 && + added_skipped_message == false + skipped_line = hLine( + ctx.module_line_w, + "{bold dim}$(N - max_n_frames - 2){/bold dim}{$(ctx.theme.err_btframe_panel) dim} frames skipped{/$(ctx.theme.err_btframe_panel) dim}"; + style = "$(ctx.theme.err_btframe_panel) dim", + ) + push!(content, skipped_line) + added_skipped_message = true + + else # show number of frames skipped - if (to_skip == false || num == length(bt) - 1) && n_skipped > 0 + if to_skip == false && n_skipped > 0 add_number_frames_skipped!( content, + ctx, to_skip, num, bt, @@ -350,33 +414,59 @@ function render_backtrace( end # skip - to_skip && begin + if to_skip n_skipped += 1 - push!(skipped_frames_modules, curr_module) + push!(skipped_frames_modules, frames_modules[num]) continue + else + n_skipped, skipped_frames_modules = 0, [] + tot_frames_added += 1 end - - # show - n_skipped, skipped_frames_modules = 0, [] - push!(content, render_backtrace_frame(numren, info; as_panel = false)) - tot_frames_added += 1 end + else + if num == length(bt) && n_skipped > 0 + add_number_frames_skipped!( + content, + ctx, + to_skip, + num, + bt, + n_skipped, + skipped_frames_modules, + ) + end + tot_frames_added += 1 end + # mark switch to a new module + (curr_module != prev_frame_module && !to_skip && !isnothing(curr_module)) && + add_new_module_name!(content, ctx, curr_module) + + # add frame if not hidden + to_skip || add_stack_frame!( + content, + frame, + ctx, + num ∈ [1, length(bt)], + num; + δ = δ, + frame_panel_kwargs..., + ) + isnothing(curr_module) || (prev_frame_module = curr_module) end # create an overall panel return Panel( - lvstack(content..., pad = 1); - padding = (2, 2, 2, 1), + cvstack(content..., pad = 1); + padding = (2, 2, 1, 1), subtitle = "Error Stack", - style = "$(theme.er_bt) dim", - subtitle_style = "bold $(theme.er_bt) default", + style = "$(ctx.theme.er_bt) dim", + subtitle_style = "bold $(ctx.theme.er_bt) default", title = "Error Stack", - title_style = "bold $(theme.er_bt) default", + title_style = "bold $(ctx.theme.er_bt) default", fit = false, justifty = :left, - width = default_stacktrace_width(), + width = ctx.out_w, ) end diff --git a/src/_inspect.jl b/src/_inspect.jl index c5b15f485..fb7bf4b73 100644 --- a/src/_inspect.jl +++ b/src/_inspect.jl @@ -30,7 +30,6 @@ function style_methods( fn_col = TERM_THEME[].func highlight_col = TERM_THEME[].inspect_highlight accent_col = TERM_THEME[].inspect_accent - mets = [] prevmod = "" for (i, m) in enumerate(methods) diff --git a/src/_repr.jl b/src/_repr.jl index fa4fec38b..434e3f47e 100644 --- a/src/_repr.jl +++ b/src/_repr.jl @@ -69,8 +69,9 @@ repr_panel( ) function vec_elems2renderables(v::Union{Tuple,AbstractVector}, N, max_w; ellipsis = false) - # shortsting(x) = x isa AbstractRenderable ? info(x) : str_trunc(string(x), max_w) - shortsting(x) = x isa AbstractRenderable ? info(x) : str_trunc(string(x), max_w) + v = Vector(v) # necessary to handle sparse vectors + shortsting(x) = + x isa AbstractRenderable ? info(x) : remove_markup(str_trunc(string(x), max_w)) out = highlight.(shortsting.(v[1:N])) ellipsis && length(v) > N && push!(out, " ⋮";) @@ -182,10 +183,12 @@ function style_function_methods(fun, methods::String; max_n = 11, width = defaul ) end methods_contents = if N > 1 - methods_texts = RenderableText.(highlight.(_methods); width = width - 20) - join(string.(map(i -> counts[i] * methods_texts[i], 1:length(counts))), '\n') + methods_texts = map(m -> reshape_code_string(m, width - 30), _methods) + + vstack(map(i -> counts[i] * methods_texts[i], 1:length(counts))...) else fun |> methods |> string |> split_lines |> first end + return methods_contents, N end diff --git a/src/_tables.jl b/src/_tables.jl index b1503c95e..c1ca1be47 100644 --- a/src/_tables.jl +++ b/src/_tables.jl @@ -12,11 +12,11 @@ function calc_columns_widths( N_rows::Int, columns_widths::Union{Nothing,Vector,Int}, show_header::Bool, - header, - tb, - sch, - footer, - hpad, + header::Union{Tuple,AbstractVector,String,Nothing}, + tb::TablesPkg.AbstractColumns, + sch, # table schema + footer::Union{Tuple,AbstractVector,String,Nothing}, + hpad::Union{Nothing,Int,AbstractVector}, ) if !isnothing(columns_widths) columns_widths = expand(columns_widths, N_cols) @@ -27,6 +27,7 @@ function calc_columns_widths( data_widths = collect(map(c -> max(width.(tb[c])...), sch.names)) footers_widths = isnothing(footer) ? zeros(N_cols) : collect(width.(footer)) widths = hcat(headers_widths, data_widths, footers_widths) + hpad = isa(hpad, Int) ? fill(hpad, N_rows) : hpad widths = Int.([mapslices(x -> max(x...), widths; dims = 2)...] .+ hpad * 2) return widths @@ -133,7 +134,7 @@ function assert_table_arguments( # if there were problems, alert user and fail gracefully if length(problems) > 0 @warn "Failed to create Term.Table" - warn_color = orange + warn_color = "yellow_light" tprintln.(" {$warn_color}" .* problems .* "{/$warn_color}"; highlight = true) end return length(problems) == 0 diff --git a/src/_text_reshape.jl b/src/_text_reshape.jl index 70721ed09..d7e1b87de 100644 --- a/src/_text_reshape.jl +++ b/src/_text_reshape.jl @@ -1,7 +1,4 @@ import Base: rpad as brpad -using WordTokenizers - -rx = r"\s*\S+\s*" """ reshape_text(text::AbstractString, width::Int) @@ -10,8 +7,13 @@ Reshape a text to have a given width. Insert newline characters in a string so that each line is within the given width. """ -function reshape_text(text::AbstractString, width::Int; ignore_markup = false) - occursin('\n', text) && (return do_by_line(ln -> reshape_text(ln, width), text)) +function reshape_text(text::AbstractString, width::Int; ignore_markup::Bool = false) + occursin('\n', text) && ( + return do_by_line( + ln -> reshape_text(ln, width::Int; ignore_markup = ignore_markup), + text, + ) + ) textlen(text) ≤ width && return text lines = [] @@ -51,8 +53,8 @@ function reshape_text(text::AbstractString, width::Int; ignore_markup = false) end end push!(lines, rstrip(line)) - out = join(lines, "\n") + out = join((fix_ansi_across_lines ∘ fix_markup_across_lines)(lines), "\n") chomp(out) end @@ -101,7 +103,7 @@ function text_to_width( text::AbstractString, width::Int, justify::Symbol; - background = nothing, + background::Union{String,Nothing} = nothing, )::String # reshape text if Measure(text).w > width diff --git a/src/_utils.jl b/src/_utils.jl index 21b3cb70f..d20c439d3 100644 --- a/src/_utils.jl +++ b/src/_utils.jl @@ -1,3 +1,17 @@ + +""" +Get a path up to the last three directories. +""" +function get_relative_path(file_path::AbstractString) + # Use the splitdir() function to split the file path into its individual components + components = splitpath(file_path) + return if length(components) > 2 + "..." * joinpath(components[(end - 2):end]...) + else + file_path + end +end + rint(x) = (Int ∘ round)(x) fint(x) = (Int ∘ floor)(x) cint(x) = (Int ∘ ceil)(x) diff --git a/src/annotations.jl b/src/annotations.jl new file mode 100644 index 000000000..f3c0aed58 --- /dev/null +++ b/src/annotations.jl @@ -0,0 +1,301 @@ +module Annotations + +import Term: fint, TERM_THEME, cleantext +import ..Renderables: AbstractRenderable, RenderableText, Renderable +import ..Segments: Segment +import ..Measures: Measure, height, width +import ..Layout: hLine, Spacer, vstack, hstack +import ..Panels: Panel +import ..Style: apply_style +import ..Consoles: console_width + +export Annotation + +# ---------------------------------------------------------------------------- # +# DECORATION # +# ---------------------------------------------------------------------------- # + +""" +struct Decoration + nun::Int + position::Int + underscore::hLine + panel::Renderable + style::String +end + +A decoration storing a message to anotate a piece of text. +`Decoration`s are used by `Annotation` to annotate text. + +A `Decoration` looks something like this when rendered. +``` +────┬─── + │ + │ ╭─────╮ + ╰─│ MSG │ + ╰─────╯ +``` +""" +struct Decoration + nun::Int + position::Int + underscore::hLine + panel::Renderable + style::String +end + +""" + Decoration(num::Int, position::Int, message::String, underscore_width::Int, style::String) + +Construct a `Decoration`. When preparing the `Panel` with the message, the `message` text +gets resized if its too large (based on `position` and `console_width`). + +## Arguments +- `num` number of decoration (for `Annotation` with multiple decorations) +- `position` position of the decoration start in the text (position of the start of the underscore) +- `message` text going inside the message box +- `underscore_width`: the width of the underscore line. +- `style`: color/style information +""" +function Decoration( + num::Int, + position::Int, + message::String, + underscore_width::Int, + style::String, +) + # create hLine underscore + underscore = hLine(underscore_width, "┬"; pad_txt = false, style = "$style dim") + + # get the width of the text, see if it needs to be adjusted + max_w = min(width(message), console_width() - position - 30) + + # create `Panel` and add the end of an "arrow" to the side. + msg_panel = Panel( + RenderableText(message; style = style, width = max_w); + fit = true, + style = "$style dim", + ) + msg_panel = + "{$style dim}│{/$style dim}" / "{$style dim}╰─{/$style dim}" * + (Spacer(0, 1) / msg_panel) + return Decoration(num, position, underscore, msg_panel, style) +end + +""" halve and round a number """ +half(x) = fint(x / 2) + +""" Make a vector of `Spacer` objects of given widths""" +make_spaces(widths::Vector{Int})::Vector{Spacer} = + collect(map(w -> Spacer(1, max(0, w)), widths)) + +""" hstack interleaved elements x ∈ X, y ∈ Y """ +join_interleaved(X, Y) = hstack([x * y for (x, y) in zip(X, Y)]...) |> string |> apply_style + +""" + overlay_decorations(decorations::Vector{Decoration}) + +Overlayed rendering of multiple `Decoration` object. +Given multiple decorations, create a visualization like: + +``` +Panel(content; fit=true) +──┬── ───┬─── ────┬─── + │ │ │ + │ ╭─────────────────────────────────╮ + ╰─│ this is the panel constructor │ + ╰─────────────────────────────────╯ + │ │ + │ ╭───────────────────────────────────────────╮ + ╰─│ here you put what goes inside the panel │ + ╰───────────────────────────────────────────╯ + │ + │ ╭──────────────────────────────────────────────────────────────────╮ + ╰─│ Setting this as `true` adjusts the panel's width to fit │ + │ `content`. Otherwise `Panel` will have a fixed width │ + ╰──────────────────────────────────────────────────────────────────╯ +``` + +Note: we need all the underscores, the vertical lines to be in the right place +and for the `Panel` with heach message to be over the lines of the following +decorations. Spacing should be accounted to make sure all messages are visible. + +Note: this function is quite long and nasty, but it seems to work well. +""" +function overlay_decorations(decorations::Vector{Decoration}) + n = length(decorations) + positions = getfield.(decorations, :position) + + # make sure decorations are in order based on position + sorter = sortperm(positions) + decorations = decorations[sorter] + positions = positions[sorter] + + # get some info + underscores_widths = width.(getfield.(decorations, :underscore)) + underscores_centers = half.(underscores_widths) + + # create the first line with all the underlines + lines = [] + lpads = map( + i -> + i == 1 ? positions[1] : + positions[i] - positions[i - 1] - underscores_widths[i - 1] + 2, + 1:n, + ) + + spaces = make_spaces(lpads) + push!(lines, join_interleaved(spaces, getfield.(decorations, :underscore))) + + # make a second line with just verticals + lpads = map( + i -> + i == 1 ? positions[1] + underscores_centers[1] - 1 : + positions[i] - positions[i - 1] - underscores_centers[i - 1] + + underscores_centers[i] - 1, + 1:n, + ) + spaces = make_spaces(lpads) + verts = map(d -> "{$(d.style) dim}│{/$(d.style) dim}", decorations) + push!(lines, join_interleaved(spaces, verts)) + + # render additional lines with their messages + decs = Dict([i => decorations[i] for i in 1:n]) + rendering = 1 + while rendering <= n + # get the pad to the left of the message panel + lpad = rendering == 1 ? lpads[1] : sum(lpads[1:rendering]) + rendering + + # get each line of the message + for i in 1:(decs[rendering].panel.measure.h) + # get the panel segment & add space to put it in the right place + ln = decs[rendering].panel.segments[i] + pad_size = rendering == 1 ? lpad : lpad - 1 + line = " "^(pad_size) * string(ln) + + # add vertical segments for every other decoration to the side of the message panel + if rendering < n + for j in (rendering + 1):n + l = width(line) + pad_size = decorations[j].position - l + underscores_centers[j] - 1 + pad_size < 0 && continue + space = " "^(pad_size) + _style = decorations[j].style + line *= space * "{$_style dim}│{/$_style dim}" + end + end + + # add to output + push!(lines, line) + end + + # add a line with the vertical elements of each decoration left to render + if rendering < n + line = " "^(positions[rendering] + underscores_centers[rendering]) + push!( + lines, + line * + join_interleaved(spaces[(rendering + 1):end], verts[(rendering + 1):end]), + ) + end + + rendering += 1 + end + + return join(lines, "\n") +end + +# ---------------------------------------------------------------------------- # +# ANNOTATION # +# ---------------------------------------------------------------------------- # + +""" + struct Annotation <: AbstractRenderable + segments::Vector + measure::Measure + end + +Represents a bit of text with some additional annotations. +Annotations are additional messages that get printed below +the main piece of text. + +## Example +```julia +Annotation("This is the text", "text"=>"this is an annotation") +```` +gives +``` +This is the text + ──┬─ + │ + │ ╭─────────────────────────╮ + ╰─│ this is an annotation │ + ╰─────────────────────────╯ +``` + +--- +This bit: +``` +──┬─ + │ + │ ╭─────────────────────────╮ + ╰─│ this is an annotation │ + ╰─────────────────────────╯ +``` +is called a `Decoration`. + +A piece of text can have multiple decorations if multiple pares are +passed in the function call above. +""" +struct Annotation <: AbstractRenderable + segments::Vector + measure::Measure + + function Annotation(text::String) + rt = RenderableText(text) + return new(rt.segments, rt.measure) + end +end + +""" + Annotation(text::String, annotations::Pair...; kwargs...) + +Construct an `Annotation`. + +The argument `annotations` is a set of `Pair`s denoting which parts +of `text` gets annotated, with what, and what style information each annotation +should have. These pairas can be of the form `String=>String` if no style information +is passed, otherwise `String=>(String, String)` where the first `String` in the +parentheses is the annotation message and the second the style info. The first `String` +in the `Pair` should be a substring of `text` to denote where the annotation occurs. +""" +function Annotation(text::String, annotations::Pair...; kwargs...) + @assert width(text) < console_width() && height(text) == 1 "Annotation can only annotate a single line, small enough to fit in the screen." + rawtext = cleantext(text) + + # create decoration objects + decorations = Decoration[] + for (i, ann) in enumerate(annotations) + match = findfirst(ann.first, rawtext) + isnothing(match) && continue + + # get the message an style + msg, style = if ann.second isa String + ann.second, TERM_THEME[].annotation_color + elseif ann.second isa Tuple + ann.second + else + error("Decoration argument could not be understood: $ann") + end + + # get the size of the annotation decoration + underscore_width = match.stop - match.start + 3 + push!(decorations, Decoration(i, match.start - 1, msg, underscore_width, style)) + end + # reverse!(decorations) + + decos = overlay_decorations(decorations) + return Annotation(text / decos) +end + +end diff --git a/src/boxes.jl b/src/boxes.jl index 97636debb..e10cd3679 100644 --- a/src/boxes.jl +++ b/src/boxes.jl @@ -168,12 +168,14 @@ function get_title_row( justify::Symbol = :left, )::Segment - # if no title just return a r ow - if isnothing(title) - return Segment(get_row(box, width, row), style) + # if no title or no space, just return a row + if isnothing(title) || width < 12 + return Segment("\e[0m{$style}" * get_row(box, width, row) * "{/$(style)}\e[0m") else title = apply_style(title) - title = textlen(title) < width - 8 ? title : str_trunc(title, width - 8) + title = + (textlen(title) < width - 12 || textlen(title) <= 4) ? title : + str_trunc(title, max(1, width - 15)) end # compose title line @@ -181,30 +183,49 @@ function get_title_row( open, close, space = "{" * style * "}", "{/" * style * "}", " " - topen, tclose = "", open + topen, tclose = "\e[0m", open if !isnothing(title_style) topen, tclose = if style == "hidden" - "\e[28m" * topen, tclose * "\e[8m" + "\e[28m" * "{" * title_style * "}", "{/" * title_style * "}" * open * "\e[8m" else "{" * title_style * "}", "{/" * title_style * "}" * open end end + + # get the title title = space * topen * title * tclose * space - if justify ≡ :left - line = open * boxline.left * boxline.mid^4 * title - line *= boxline.mid^(width - textlen(line) - 1) * boxline.right * close - elseif justify ≡ :right - pre_len = width - textlen(title) - 4 - line = open * get_lrow(box, pre_len, row) - line *= title * boxline.mid^3 * boxline.right * close - else # justify :center - tl, tr = get_lr_widths(textlen(title)) - lw, rw = get_lr_widths(width) - line = - open * get_lrow(box, lw - tl, row) * title * get_rrow(box, rw - tr, row) * close - return Segment(line * "\e[0m") + + # only add the title if the box is wide enough + if width < 6 + line = open * boxline.left * boxline.mid^(width - 2) * boxline.right * close + else + # close the box + if justify ≡ :left + line = open * boxline.left * boxline.mid^4 * title + + # check if the title is too long + if width - textlen(line) - 1 < 1 + line = open * boxline.left * boxline.mid^2 * title + end + + line *= boxline.mid^(max(1, width - textlen(line) - 1)) * boxline.right * close + elseif justify ≡ :right + pre_len = width - textlen(title) - 4 + line = open * get_lrow(box, pre_len, row) + line *= title * boxline.mid^3 * boxline.right * close + else # justify :center + tl, tr = get_lr_widths(textlen(title)) + lw, rw = get_lr_widths(width) + line = + open * + get_lrow(box, lw - tl, row) * + title * + get_rrow(box, rw - tr, row) * + close + return Segment("\e[0m" * line * "\e[0m") + end end - return Segment(line * "\e[0m") + return Segment("\e[0m" * line * "\e[0m") end """ diff --git a/src/colors.jl b/src/colors.jl index 3d9201613..c4ce113e0 100644 --- a/src/colors.jl +++ b/src/colors.jl @@ -1,17 +1,16 @@ module Colors -import Term: - NAMED_COLORS, - nospaces, - COLORS_16b, - remove_brackets, - ANSICode, - rint, - CODES, - CODES_16BIT_COLORS +import Term: NAMED_COLORS, COLORS_16b, ANSICode, rint, CODES, CODES_16BIT_COLORS export NamedColor, BitColor, RGBColor, get_color +""" + nospaces(text::AbstractString) + +Remove all spaces from a string. +""" +nospaces(text::AbstractString) = replace(text, " " => "") + # ----------------------------- types definition ----------------------------- # """ AbstractColor diff --git a/src/console.jl b/src/console.jl index abca05b47..776916a84 100644 --- a/src/console.jl +++ b/src/console.jl @@ -138,7 +138,7 @@ function enable(console::Console) nothing end -function disable(console::Console) +function disable(::Console) ACTIVE_CONSOLE_WIDTH[] = nothing end end diff --git a/src/errors.jl b/src/errors.jl index 46b3ce280..00bdd0be6 100644 --- a/src/errors.jl +++ b/src/errors.jl @@ -4,6 +4,7 @@ import Base: show_method_candidates, ExceptionStack, InterpreterIP import Term: highlight, + highlight_syntax, str_trunc, reshape_text, load_code_and_highlight, @@ -12,220 +13,63 @@ import Term: unescape_brackets, remove_markup, TERM_THEME, - plural - + plural, + Theme, + do_by_line, + STACKTRACE_HIDDEN_MODULES, + STACKTRACE_HIDE_FRAMES, + reshape_code_string, + TERM_SHOW_LINK_IN_STACKTRACE + +import ..Links: Link +import ..Style: apply_style import ..Layout: - hLine, rvstack, cvstack, rvstack, vstack, vLine, Spacer, hstack, lvstack, pad + hLine, + rvstack, + cvstack, + rvstack, + vstack, + vLine, + Spacer, + hstack, + lvstack, + pad, + vertical_pad import ..Renderables: RenderableText, AbstractRenderable import ..Panels: Panel +import ..Measures: height export install_term_stacktrace -include("_errors.jl") - -# ----------------------- error type specific messages ----------------------- # - -# ! ARGUMENT ERROR -error_message(er::ArgumentError) = er.msg - -# ! ASSERTION ERROR -error_message(er::AssertionError) = return er.msg - -# ! BOUNDS ERROR -function error_message(er::BoundsError) - # @info "bounds error" er fieldnames(typeof(er)) - obj = escape_brackets(string(typeof(er.a))) - println(obj) - if er.a isa AbstractArray - obj = "a `$obj` width shape $(string(size(er.a)))" - end - main_msg = "Attempted to access $(obj) at index $(er.i)" - - additional_msg = "" - - if isdefined(er, :a) - if er.a isa AbstractString - nunits = ncodeunits(er.a) - additional_msg = "String has $nunits codeunits, $(length(er.a)) characters." - end - else - additional_msg = "{red}Variable is not defined!.{/red}" - end - - return highlight(main_msg) / additional_msg -end - -# ! Domain ERROR -function error_message(er::DomainError) - # @info "err exceprion" er fieldnames(DomainError) er.val - # msg = split(er.msg, " around ")[1] - return er.msg / "The invalid value is: $(er.val)." -end - -# ! DimensionMismatch -error_message(er::DimensionMismatch) = er.msg - -# ! DivideError -error_message(er::DivideError) = "Attempted integer division by {bold}0{/bold}" - -# ! EXCEPTION ERROR -function error_message(er::ErrorException) - # @info "err exceprion" er fieldnames(ErrorException) er.msg - msg = split(er.msg, " around ")[1] - return msg -end - -# ! KeyError -function error_message(er::KeyError) - # @info "err KeyError" er fieldnames(KeyError) - # key = truncate(string(er.key), 40) - key = string(er.key) - msg = "Key `$(key)` not found!" - return msg -end - -# ! InexactError -function error_message(er::InexactError) - # @info "load error message" fieldnames(InexactError) - msg = "Cannot convert $(er.val) to type ::$(er.T)" - subm = "Conversion error in function: $(er.func)" - return msg / subm -end - -# ! LoadError -function error_message(er::LoadError) - theme = TERM_THEME[] - # @info "load error message" fieldnames(LoadError) - msg = "At {$(theme.err_filepath) underline}$(er.file){/$(theme.err_filepath) underline} line {bold}$(er.line){/bold}" - subm = "The cause is an error of type: {$(theme.err_errmsg)}$(string(typeof(er.error)))" - return msg / subm -end - -# ! METHOD ERROR -method_error_regex = r"(?\!Matched\:\:(\w|\.)+)" -function method_error_candidate(fun, candidate) - theme = TERM_THEME[] - # highlight non-matched types - candidate = replace( - candidate, - method_error_regex => SubstitutionString( - "{$(theme.err_errmsg)}" * s"\g<0>" * "{/$(theme.err_errmsg)}", - ), - ) - # remove - candidate = replace(candidate, "!Matched" => "") - - # highlight fun - candidate = replace(candidate, string(fun) => "{$(theme.func)}$(fun){/$(theme.func)}") - return candidate -end - -function error_message(er::MethodError; kwargs...) - f = er.f - ft = typeof(f) - name = ft.name.mt.name - kwargs = () - if endswith(string(ft.name.name), "##kw") - f = er.args[2] - ft = typeof(f) - name = ft.name.mt.name - # arg_types_param = arg_types_param[3:end] - kwargs = pairs(er.args[1]) - # er = MethodError(f, er.args[3:end::Int]) - end - - # get main error message - _args = join( - map( - a -> - " {dim bold}($(a[1])){/dim bold} $(highlight("::"*string(typeof(a[2]))))\n", - enumerate(er.args), - ), +""" +Stores information useful for creating the layout +of a stack trace visualization. +""" +struct StacktraceContext + out_w::Int # max width of the stacktrace + frame_panel_w::Int # width of inner elements like frame panels + module_line_w::Int # width of hline to print module name + func_name_w::Int # width of frame's function name and file + code_w::Int # width of code panels + theme::Theme +end + +function StacktraceContext(w = default_stacktrace_width()) + frame_panel_w = w - 4 - 12 - 3 # panel walls and padding + module_line_w = w - 4 - 4 + func_name_w = frame_panel_w - 4 - 8 # including (n) before fname + code_w = func_name_w - 8 + return StacktraceContext( + w, + frame_panel_w, + module_line_w, + func_name_w, + code_w, + TERM_THEME[], ) - main_line = - "No method matching {bold $(TERM_THEME[].emphasis)}`$name`{/bold $(TERM_THEME[].emphasis)} with arguments types:" / - _args - - # get recomended candidates - _candidates = split(sprint(show_method_candidates, er), "\n")[3:(end - 1)] - - if length(_candidates) > 0 - _candidates = map(c -> split(c, " at ")[1], _candidates) - candidates = map(c -> method_error_candidate(name, c), _candidates) - main_line /= lvstack("", "Alternative candidates:", candidates...) - else - main_line = main_line / " " / "{dim}No alternative candidates found" - end - - return string(main_line) -end - -# ! StackOverflowError -error_message(er::StackOverflowError) = "Stack overflow error: too many function calls." - -# ! TYPE ERROR -function error_message(er::TypeError) - # @info "type err" er fieldnames(typeof(er)) er.func er.context er.expected er.got - theme = TERM_THEME[] - msg = "In `$(er.func)` > `$(er.context)` got" - msg *= " {$(theme.emphasis_light)) bold}$(er.got){/$(theme.emphasis_light)) bold}(::$(typeof(er.got))) but expected argument of type ::$(er.expected)" - return msg -end - -# ! UndefKeywordError -function error_message(er::UndefKeywordError) - # @info "UndefKeywordError" er er.var typeof(er.var) fieldnames(typeof(er.var)) - return "Undefined function keyword argument: {bold}`$(er.var)`{/bold}." -end - -# ! UNDEFVAR ERROR -function error_message(er::UndefVarError) - # @info "undef var error" er er.var typeof(er.var) - return "Undefined variable {bold}`$(er.var)`{/bold}." -end - -# ! STRING INDEX ERROR -function error_message(er::StringIndexError) - # @info er typeof(er) fieldnames(typeof(er)) - m1 = "attempted to access a String at index $(er.index)\n" - return m1 end -# ! SYSTEM ERROR -function error_message(er::SystemError) - if @static(Sys.iswindows() ? er.extrainfo isa WindowsErrorInfo : false) - errstring = Libc.FormatMessage(er.extrainfo.errnum) - extrainfo = er.extrainfo.extrainfo - else - errstring = Libc.strerror(er.errnum) - extrainfo = er.extrainfo - end - if extrainfo === nothing - return "$(er.prefix)\n" * errstring - else - return "SystemError (with $extrainfo): $(er.prefix)\n" * errstring - end -end - -# ! catch all other errors -function error_message(er) - # @debug "Error message type doesnt have a specialized method!" er typeof(er) fieldnames( - # typeof(er) - # ) - theme = TERM_THEME[] - if hasfield(typeof(er), :error) - # @info "nested error" typeof(er.error) - m1, _ = error_message(er.error) - msg = "\n{bold $(theme.err_errmsg)}LoadError:{/bold $(theme.err_errmsg)}\n" * m1 - else - msg = if hasfield(typeof(er), :msg) - er.msg - else - "no message for error of type $(typeof(er)), sorry." - end - end - return msg -end +include("_errors.jl") # ---------------------------------------------------------------------------- # # INSTALL STACKTRACE # @@ -253,10 +97,13 @@ function install_term_stacktrace(; ) @eval begin function Base.showerror(io::IO, er, bt; backtrace = true) - theme = TERM_THEME[] - (length(bt) == 0 && !isa(er, StackOverflowError)) && return nothing + print(io, "\n") + # @info "Showing" er bt + + # shorten very long backtraces isa(er, StackOverflowError) && (bt = [bt[1:25]..., bt[(end - 25):end]...]) + # if the terminal is too narrow, avoid using Term's functionality if default_stacktrace_width() < 70 println(io) @warn "Term.jl: can't render error message, console too narrow. Using default stacktrace" @@ -267,43 +114,61 @@ function install_term_stacktrace(; end try - println("\n") + # create a StacktraceContext + ctx = StacktraceContext() + + # print an hLine with the error name ename = string(typeof(er)) - print( + length(bt) > 0 && print( + io, hLine( - "{default bold $(theme.err_errmsg)}$ename{/default bold $(theme.err_errmsg)}"; - style = "dim $(theme.err_errmsg)", + "{default bold $(ctx.theme.err_errmsg)}$ename{/default bold $(ctx.theme.err_errmsg)}"; + style = "dim $(ctx.theme.err_errmsg)", ), ) - # print error stacktrace + # print error backtrace or panel if length(bt) > 0 rendered_bt = render_backtrace( + ctx, bt; reverse_backtrace = $(reverse_backtrace), max_n_frames = $(max_n_frames), hide_frames = $(hide_frames), ) - print(rendered_bt) + print(io, rendered_bt) end - # print error message and description - Panel( - RenderableText( - error_message(er), - # width = default_stacktrace_width() - 4, - ); - width = default_stacktrace_width(), - title = "{bold $(theme.err_errmsg) default underline}$(typeof(er)){/bold $(theme.err_errmsg) default underline}", - padding = (2, 2, 1, 1), - style = "dim $(theme.err_errmsg)", - title_justify = :center, - fit = false, - ) |> print + # print message panel if VSCode is not handling that through a second call to this fn + (hasfield(typeof(io), :io) && isa(io.io, Base.TTY)) && begin + msg = highlight(sprint(Base.showerror, er)) |> apply_style + err_panel = Panel( + RenderableText( + reshape_code_string(msg, ctx.module_line_w); + width = ctx.module_line_w, + ); + width = ctx.out_w, + title = "{bold $(ctx.theme.err_errmsg) default underline}$(typeof(er)){/bold $(ctx.theme.err_errmsg) default underline}", + padding = (2, 2, 1, 1), + style = "dim $(ctx.theme.err_errmsg)", + title_justify = :center, + fit = false, + ) + print(io, err_panel) + end catch cought_err # catch when something goes wrong during error handling in Term - @error "Term.jl: error while rendering error message: " exception = - cought_err + @error "Term.jl: error while rendering error message: " cought_err + + for (i, (exc, _bt)) in enumerate(current_exceptions()) + i == 1 && println("Error during term's stacktrace generation:") + Base.show_backtrace(io, _bt) + print(io, '\n'^3) + Base.showerror(io, exc) + end + + print(io, '\n'^5) + println(io, "Original error:") Base.show_backtrace(io, bt) print(io, '\n'^3) Base.showerror(io, er) diff --git a/src/highlight.jl b/src/highlight.jl index 6af97adfb..7cfc2d555 100644 --- a/src/highlight.jl +++ b/src/highlight.jl @@ -8,12 +8,12 @@ using Highlights.Format highlight_regexes = OrderedDict( :number => (r"(?(? - (r"(?(?(?![\:\<])[\+\-\*\%\^\&\|\!\=\>\<\~])"), + (r"(?(?(?![\:\<])[\+\-\*\%\^\&\|\!\=\>\<\~\[\]])"), :string => (r"(?[\'\"][\w\n]*[\'\"])",), :code => (r"(?([\`]{3}|[\`]{1})(\n|.)*?([\`]{3}|[\`]{1}))",), :expression => (r"(?\:\(+.+[\)])",), :symbol => (r"(?(? (r"(?[\[\]\(\)])", r"(?@\w+)"), + # :emphasis_light => (r"(?[\[\]\(\)])", r"(?@\w+)"), :type => (r"(?\:\:[\w\.]*)", r"(?\<\:\w+)"), ) @@ -23,8 +23,12 @@ highlight_regexes = OrderedDict( Highlighs a text introducing markup to style semantically relevant segments, colors specified by a theme object. """ -function highlight(text::AbstractString; theme::Theme = TERM_THEME[]) - has_ansi(text) && return text +function highlight( + text::AbstractString; + theme::Theme = TERM_THEME[], + ignore_ansi::Bool = false, +) + (has_ansi(text) && !ignore_ansi) && return text # highlight with regexes for (symb, rxs) in pairs(highlight_regexes) @@ -35,7 +39,6 @@ function highlight(text::AbstractString; theme::Theme = TERM_THEME[]) end end - # return remove_markup(apply_style(text)) return text end @@ -45,33 +48,11 @@ end Hilights an entire text as if it was a type of semantically relevant text of type :like. """ -function highlight(text::AbstractString, like::Symbol; theme::Theme = TERM_THEME[]) - markup = getfield(theme, like) - return apply_style( - do_by_line((x) -> "{" * markup * "}" * x * "{/" * markup * "}", chomp(text)), - ) -end +highlight(text::AbstractString, like::Symbol; theme::Theme = TERM_THEME[]) = + apply_style(text, getfield(theme, like)) # shorthand to highlight objects based on type -highlight(x::Union{UnionAll,DataType}; theme::Theme = TERM_THEME[]) = - highlight(string(x), :type; theme = theme) - -highlight(x::Number; theme::Theme = TERM_THEME[]) = - highlight(string(x), :number; theme = theme) - -highlight(x::Function; theme::Theme = TERM_THEME[]) = - highlight(string(x), :func; theme = theme) - -highlight(x::Symbol; theme::Theme = TERM_THEME[]) = - highlight(string(x), :symbol; theme = theme) - -highlight(x::Expr; theme::Theme = TERM_THEME[]) = - highlight(string(x), :expression; theme = theme) - -highlight(x::AbstractVector; theme::Theme = TERM_THEME[]) = - highlight(string(x), :number; theme = theme) - -highlight(x; theme = TERM_THEME[]) = string(x) # capture all other cases +highlight(x; theme = TERM_THEME[]) = apply_style(string(x), theme(x)) # capture all other cases # ------------------------------ Highlighters.jl ----------------------------- # @@ -112,10 +93,8 @@ function highlight_syntax(code::AbstractString; style::Bool = true) CodeTheme; context = stdout, ) - txt = unescape_brackets(txt) style && (txt = apply_style(txt)) - - return do_by_line(rstrip, remove_markup(txt)) + return remove_markup(txt) end """ @@ -130,8 +109,9 @@ function load_code_and_highlight(path::AbstractString, lineno::Int; δ::Int = 3) lines = read_file_lines(path, lineno - δ, lineno + δ) linenos = first.(lines) - lines = [ln[2] for ln in lines] - code = split(highlight_syntax(join(lines); style = true), "\n") + code = + [highlight_syntax((δ == 0 ? lstrip(ln[2]) : ln[2]); style = true) for ln in lines] + code = split(join(code), "\n") # clean clean(line) = replace(line, " {/ }" => "") @@ -157,7 +137,6 @@ function load_code_and_highlight(path::AbstractString, lineno::Int; δ::Int = 3) " ", "grey39" end - # end line = textlen(line) > 1 ? lpad(line[dedent:end], 8) : line push!(cleaned_lines, symb * " {$color}$n{/$color} " * line) end diff --git a/src/layout.jl b/src/layout.jl index 4b3526e25..a71235841 100644 --- a/src/layout.jl +++ b/src/layout.jl @@ -12,14 +12,16 @@ import Term: ltrim_str, do_by_line, get_bg_color, - TERM_THEME + TERM_THEME, + string_type + import Term: justify as justify_text import ..Renderables: RenderablesUnion, Renderable, AbstractRenderable, RenderableText import ..Consoles: console_width, console_height import ..Measures: Measure, height, width import ..Boxes: get_lrow, get_rrow import ..Style: apply_style -import ..Segments: Segment +import ..Segments: Segment, get_string_types using ..Boxes export Padding, vstack, hstack, pad, pad!, vertical_pad, vertical_pad! @@ -65,7 +67,7 @@ julia> pad("ciao", 10, :right) " ciao" ``` """ -function pad(text::AbstractString, target_width::Int, method::Symbol; bg = nothing)::String +function pad(text::AbstractString, target_width::Int, method::Symbol; bg = nothing) bg = get_bg_color(bg) occursin('\n', text) && return do_by_line(ln -> pad(ln, target_width, method; bg = bg), text) @@ -73,24 +75,32 @@ function pad(text::AbstractString, target_width::Int, method::Symbol; bg = nothi # get total padding size lw = width(text) lw ≥ target_width && return text + return pad(text, target_width, method, lw; bg = bg) +end + +""" + function pad(text::AbstractString, target_width::Int, method::Symbol, lw::Int; bg = nothing)::String +complete string padding but knowing line width of the string. +Useful in cases the line width needs to be enforced instead of obtained through `width(text)`, e.g. +when paddnig a `Link`'s text. +""" +function pad(text::AbstractString, target_width::Int, method::Symbol, lw::Int; bg = nothing) + stype = string_type(text) npads = target_width - lw + # println("TEXT ", text, " NPADS ", npads, " METHOD ", method, " lw ", lw) if method ≡ :left p = isnothing(bg) ? ' '^npads : "{$bg}" * ' '^npads * "{/$bg}" - return text * p + return text * p |> stype elseif method ≡ :right p = isnothing(bg) ? ' '^npads : "{$bg}" * ' '^npads * "{/$bg}" - return p * text + return p * text |> stype else nl, nr = get_lr_widths(npads) l = isnothing(bg) ? ' '^nl : "{$bg}" * ' '^nl * "{/$bg}" r = isnothing(bg) ? ' '^nr : "{$bg}" * ' '^nr * "{/$bg}" t = l * text * r - return if method == :center - t - else - justify_text(t, target_width) - end + return t |> stype end end @@ -100,14 +110,39 @@ end Pad a string by a fixed ammount to the left and to the right. """ -pad(text::AbstractString, left::Int = 0, right::Int = 0; bg = nothing) = +function pad(text::AbstractString, left::Int = 0, right::Int = 0; bg = nothing) + stype = string_type(text) if isnothing(bg) - ' '^max(0, left) * text * ' '^max(0, right) + (' '^max(0, left) * text * ' '^max(0, right)) |> stype else l = "{$bg}" * ' '^max(0, left) * "{/$bg}" r = "{$bg}" * ' '^max(0, right) * "{/$bg}" - l * text * r + (l * text * r) |> stype + end +end + +""" +--- + + pad(s::Segment, left::Int = 0, right::Int = 0; kwargs...) + +Pad a segment. +""" +pad(s::Segment, left::Int = 0, right::Int = 0; kwargs...) = Segment( + pad(s.text, left, right; kwargs...), + Measure(s.measure.h, s.measure.w + left + right), +) + +function pad(s::Segment, width::Int, method::Symbol; kwargs...) + return if width <= s.measure.w + s + else + Segment( + pad(s.text, width, method, s.measure.w; kwargs...), + Measure(s.measure.h, width), + ) end +end """ --- @@ -115,8 +150,8 @@ pad(text::AbstractString, left::Int = 0, right::Int = 0; bg = nothing) = Pad a renderable's segments to the left and the right. """ -pad(segments::AbstractVector{Segment}, left::Int = 0, right::Int = 0) = - map((s) -> Segment(pad(s.text, left, right)), segments) +pad(segments::AbstractVector{Segment}, left::Int = 0, right::Int = 0; kwargs...) = + map((s) -> pad(s, left, right; kwargs...), segments) """ --- @@ -124,8 +159,8 @@ pad(segments::AbstractVector{Segment}, left::Int = 0, right::Int = 0) = Pad an `AbstractRenderable` by padding each of its segments. """ -function pad(ren::AbstractRenderable, left::Int, right::Int) - segments = pad(ren.segments, left, right) +function pad(ren::AbstractRenderable, left::Int, right::Int; kwargs...) + segments = pad(ren.segments, left, right; kwargs...) return Renderable(segments, Measure(segments)) end @@ -146,8 +181,16 @@ julia> pad(RenderableText("ciao"); width=10) ciao ``` """ -function pad(ren::AbstractRenderable; width::Int) - nl, nr = get_lr_widths(width - ren.measure.w) +function pad(ren::AbstractRenderable; width::Int, method = :center) + ren.measure.w >= width && return ren + + if method == :center + nl, nr = get_lr_widths(width - ren.measure.w) + elseif method == :right + nl, nr = 0, width - ren.measure.w + else + nl, nr = width - ren.measure.w, 0 + end return pad(ren, nl, nr) end @@ -158,7 +201,8 @@ In place version for padding a renderable. """ function pad!(ren::AbstractRenderable, left::Int, right::Int) ren.segments = pad(ren.segments, left, right) - return ren.measure = Measure(ren.segments) + ren.measure = Measure(ren.segments) + nothing end """ @@ -167,6 +211,7 @@ end In place version for padding a renderable to achieve a given width. """ function pad!(ren::AbstractRenderable; width::Int) + ren.measure.w >= width && return ren nl, nr = get_lr_widths(width - ren.measure.w) return pad!(ren, nl, nr) end @@ -179,7 +224,7 @@ vertical_pad(text, target_height::Int, method::Symbol)::String Vertically pad a string to height: `target_height` by adding empty strings above/below " ". Where the spaces are added depends on the justification `method` ∈ (:top, :center, :bottom). """ -function vertical_pad(text::AbstractString, target_height::Int, method::Symbol)::String +function vertical_pad(text::AbstractString, target_height::Int, method::Symbol) # get total padding size h = height(text) h ≥ target_height && return text @@ -201,8 +246,9 @@ end Vertical pad a string by a fixed ammount to above and below. """ function vertical_pad(text::AbstractString, above::Int = 0, below::Int = 0) + stype = string_type(text) space = ' '^(width(text)) - return string(vstack(fill(space, above)..., text, fill(space, below)...)) + return stype(vstack(fill(space, above)..., text, fill(space, below)...)) end """ @@ -232,9 +278,16 @@ vertical_pad(ren::AbstractRenderable; height::Int) Vertical pad a renderable to achieve a target height. """ -function vertical_pad(ren::AbstractRenderable; height::Int) - nl, nr = get_lr_widths(height - ren.measure.h) - return vertical_pad(ren, nl, nr) +function vertical_pad(ren::AbstractRenderable; height::Int, method = :center) + ren.measure.h >= height && return ren + if method == :center + n_above, n_below = get_lr_widths(height - ren.measure.h) + elseif method == :bottom + n_above, n_below = height - ren.measure.h, 0 + elseif method == :top + n_above, n_below = 0, height - ren.measure.h + end + return vertical_pad(ren, n_above, n_below) end """ @@ -287,8 +340,7 @@ function leftalign(renderables::RenderablesUnion...) length(renderables) < 2 && return renderables renderables = Renderable.(renderables) width = maximum(map(r -> r.measure.w, renderables)) - renderables = map(r -> pad(r, 0, width - r.measure.w), renderables) - return renderables + return map(r -> pad(r, 0, width - r.measure.w), renderables) end """ @@ -488,8 +540,13 @@ function hstack(r1::RenderablesUnion, r2::RenderablesUnion; pad::Int = 0) end # combine segments - segments = [Segment(ss1.text * ' '^pad * ss2.text) for (ss1, ss2) in zip(s1, s2)] - + stype = get_string_types(s1, s2) + segments = [ + Segment( + stype(ss1.text * ' '^pad * ss2.text), + Measure(1, ss1.measure.w + pad + ss2.measure.w), + ) for (ss1, ss2) in zip(s1, s2) + ] return Renderable(segments, Measure(segments)) end @@ -506,9 +563,6 @@ function hstack(renderables...; pad::Int = 0) return renderable end -hstack(renderables::Union{AbstractVector,Tuple}; kwargs...) = - hstack(renderables...; kwargs...) - # --------------------------------- operators -------------------------------- # """ @@ -516,8 +570,6 @@ hstack(renderables::Union{AbstractVector,Tuple}; kwargs...) = """ Base.:/(r1::RenderablesUnion, r2::RenderablesUnion) = vstack(r1, r2) -Base.:/(rr::Tuple{RenderablesUnion,RenderablesUnion}) = vstack(rr...) -Base.:/(rr...) = vstack Base.:*(r1::AbstractRenderable, r2::AbstractRenderable) = hstack(r1, r2) Base.:*(r1::AbstractString, r2::AbstractRenderable) = hstack(r1, r2) @@ -652,17 +704,19 @@ function hLine( text::String; style::String = TERM_THEME[].line, box::Symbol = TERM_THEME[].box, + pad_txt::Bool = true, ) box = BOXES[box] text = apply_style(text) * "\e[0m" tl, tr = get_lr_widths(textlen(text)) lw, rw = get_lr_widths(width) + _pad = pad_txt ? " " : get_lrow(box, 1, :top; with_left = false) line = get_lrow(box, lw - tl, :top; with_left = false) * - " " * + _pad * text * - " " * + _pad * "{$style}" * get_rrow(box, rw - tr, :top; with_right = false) * "\e[0m" diff --git a/src/link.jl b/src/link.jl index f4ef8a433..16415f099 100644 --- a/src/link.jl +++ b/src/link.jl @@ -1,9 +1,163 @@ -function create_link(filepath::String) - parts = splitpath(filepath) - name = length(parts) > 3 ? joinpath(parts[(end - 2):end]) : joinpath(parts) - return "\e]8;;file:" * filepath * "\a" * name * "\e]8;;\a" +module Links +import ..Measures: Measure, width +import ..Measures +import ..Segments +import ..Segments: Segment +import ..Style: apply_style +import ..Renderables: RenderableText, AbstractRenderable +import ..Renderables +import ..Layout: pad +import Term: + get_relative_path, textlen, TERM_THEME, cleantext, excise_link_display_text, remove_ansi +import Term + +export Link + +""" + struct LinkString <: AbstractString + link::String + width::Int + end + +`LinkString` behaves like a sting, but it's sneaky. +It keeps track of a link which has different length as a string +and when printed. So we override a lot of the normal string's behavior +to get it to work with renderables. +""" +struct LinkString <: AbstractString + link::String + width::Int +end + +""" + LinkString(s::String) + +Construct a LinkString from a normal string, taking +into account that there might be a link in there, +so get the right width. +""" +function LinkString(s::String) + link_width, additional_text_w = 0, 0 + for line in split(s, "\n") + link_txt = excise_link_display_text(line) + link_width = max(link_width, width(link_txt)) + additional_text = split(remove_ansi(line), "8;;\e\\") + length(additional_text) > 1 && + (additional_text_w = max(additional_text_w, width(additional_text[2]))) + end + LinkString(s, link_width + additional_text_w + 3) +end + +LinkString(l::LinkString) = l + +Base.:*(s::Union{SubString,String}, l::LinkString) = + LinkString(s * l.link, textlen(s) + l.width) +Base.:*(l::LinkString, s::Union{SubString,String}) = + LinkString(l.link * s, textlen(s) + l.width) +Base.:/(s::Union{SubString,String}, l::LinkString) = + LinkString(s / l.link, max(textlen(s), l.width)) +Base.:/(l::LinkString, s::Union{SubString,String}) = + LinkString(l.link / s, max(textlen(s), l.width)) + +Segments.Segment(l::LinkString) = Segment(l, Measure(1, l.width)) +Term.textlen(l::LinkString) = l.width +Term.split_lines(l::LinkString) = Term.split_lines(l.link) + +""" + struct Link <: AbstractRenderable + segments::Vector{Segment} + measure::Measure + link::LinkString + style::String + display_text::String + link_dest::String + end + +A link renderable. With a link to an url or file path +and a text that gets displayed (and is clickable on most terminals). +Key to it working as a properly renderable is its `LinkString` +""" +struct Link <: AbstractRenderable + segments::Vector{Segment} + measure::Measure + link::LinkString + style::String + display_text::String + link_dest::String +end + +Base.textwidth(l::LinkString) = l.width +Base.string(l::LinkString) = l +Base.convert(::String, l) = l +Base.print(io::IO, s::LinkString) = print(io, s.link) +Base.show(io::IO, ::MIME"text/plain", l::LinkString) = print(io, l.link) + +""" + Link( + file_path::AbstractString, + line_number::Union{Nothing,Integer} = nothing; + style = TERM_THEME[].link, + ) + +Build a link given a file path and line number. +""" +function Link( + file_path::AbstractString, + line_number::Union{Nothing,Integer} = nothing; + style = TERM_THEME[].link, +) + link_dest = isnothing(line_number) ? file_path : "$file_path#$line_number" + short_path = get_relative_path(file_path) + display_text = isnothing(line_number) ? short_path : "$short_path $(line_number)" + link_text = + "{$(style)}" * + "\x1b]8;;$link_dest\x1b\\$display_text\x1b]8;;\x1b\\" * + "{/$(style)}" |> apply_style + link_measure = Measure(1, textlen(display_text)) + + link_string = LinkString(link_text, link_measure.w) + return Link( + [Segment(link_string)], + link_measure, + link_string, + style, + display_text, + link_dest, + ) +end + +""" +--- + Renderables.RenderableText( + link::Link, + args...; + style::Union{Nothing,String} = link.style, + width::Int = link.measure.w, + background::Union{Nothing,String} = nothing, + justify::Symbol = :left, + ) + +Custom constructor to make a `RenderableText` out of a `Link`, +specialized to take into account `Link`'s different sizes +between displayed and actual text. +""" +function Renderables.RenderableText( + link::Link, + args...; + style::Union{Nothing,String} = link.style, + width::Int = link.measure.w, + background::Union{Nothing,String} = nothing, + justify::Symbol = :left, +) + display_text = + pad(cleantext(link.display_text), width - link.measure.w, justify; bg = background) + link_text = + "{$(style)}" * + "\x1b]8;;$(link.link_dest)\x1b\\$display_text\x1b]8;;\x1b\\" * + "{/$(style)}" |> apply_style + link_string = LinkString(link_text, link.measure.w) + + return RenderableText(Segment[Segment(link_string)], link.measure, style) end -function creat_link(url::String, name::String) - return "\e]8;;" * url * "\a" * name * "\e]8;;\a" end diff --git a/src/logs.jl b/src/logs.jl index f2c00f074..1ec43e716 100644 --- a/src/logs.jl +++ b/src/logs.jl @@ -15,13 +15,12 @@ import Term: rint, highlight, TERM_THEME, - str_trunc, - ltrim_str + str_trunc import ..Consoles: console_width, console_height, change_scroll_region, move_to_line -import ..Renderables: AbstractRenderable +import ..Renderables: AbstractRenderable, RenderableText import ..Style: apply_style -import ..Tprint: tprintln +import ..Tprint: tprintln, tprint import ..Boxes: BOXES import ..Progress: ProgressBar, @@ -37,6 +36,8 @@ import ..Progress: getjob, SeparatorColumn, PercentageColumn +import ..Measures: width, height +import ..Layout: hstack, rvstack, lvstack, vertical_pad, pad export TermLogger, install_term_logger @@ -146,6 +147,33 @@ function handle_progress(logger::TermLogger, prog) end end +style_log_msg_kw_value(logger, v::Number) = (v, logger.theme.number) +style_log_msg_kw_value(logger, v::Symbol) = (v, logger.theme.symbol) +style_log_msg_kw_value(logger, v::AbstractString) = (v, logger.theme.string) +style_log_msg_kw_value(logger, v::Function) = (v, logger.theme.func) +style_log_msg_kw_value(logger, v::AbstractRenderable) = + ("$(typeof(v)) \e[2m$(v.measure)\e[0m", "default") +style_log_msg_kw_value(logger, v) = (v, nothing) + +function style_log_msg_kw_value(logger, v::AbstractVector) + _style = logger.theme.number + _size = length(v) + v = escape_brackets(string(v)) + v = textlen(v) > 60 ? v[1:57] * "..." : v + v *= "\n {$(logger.theme.text)}$(_size) {/$(logger.theme.text)}{dim}items{/dim}" + return (v, _style) +end +function style_log_msg_kw_value(logger, v::Union{AbstractArray,AbstractMatrix}) + _style = logger.theme.number + _size = size(v) + v = str_trunc("$(typeof(v)) {dim}<: $(supertypes(typeof(v))[end-1]){/dim}", 60) + v *= + "\n {dim}shape: {default $(logger.theme.text)}" * + join(string.(_size), " × ") * + "{/default $(logger.theme.text)}{/dim}" + return (v, _style) +end + """ handle_message(logger::TermLogger, lvl, msg, _mod, group, id, file, line; kwargs...) @@ -165,6 +193,7 @@ function Logging.handle_message( line; kwargs..., ) + # handle log progress _progress = asprogress(lvl, msg, _mod, group, id, file, line; kwargs...) isnothing(_progress) || return handle_progress(logger, _progress) @@ -188,119 +217,92 @@ function Logging.handle_message( else "#90CAF9" end - outline_markup = "$color dim" vert = "{$outline_markup}" * BOXES[:ROUNDED].mid.left * "{/$outline_markup}" - # style message + # ---------------------------------- message --------------------------------- # logmsg_color = logger.theme.logmsg - msg = if msg isa AbstractString - reshape_text(has_markup(msg) ? msg : "{$logmsg_color}$msg{/$logmsg_color}", 64) - else - "{$logmsg_color}" * reshape_text(string(msg), 64) * "{/$logmsg_color}" - end - msg = length(msg) > 1000 ? ltrim_str(msg, 997) * "..." : msg + msg = string(msg) + msg = length(msg) > 1500 ? ltrim_str(msg, 1500 - 3) * "..." : msg - # get the first line of information + # prepare the first line of information fn_color = logger.theme.func - content = "{$color underline bold}@$(string(lvl)){/$color underline bold} {$fn_color }($(_mod)$fname):{/$fn_color }" + firstline = "{$color underline bold}@$(string(lvl)){/$color underline bold} {$fn_color }($(_mod)$fname):{/$fn_color }" + + # print first line + msg_lines = split(msg, "\n") + length(msg_lines) > 0 && ( + firstline *= + " " * RenderableText( + reshape_text(msg_lines[1], console_width() - textlen(firstline) - 1); + style = logmsg_color, + ) + ) + tprint(firstline; highlight = false) # for multi-lines message, print each line separately. - msg_lines::Vector{AbstractString} = split(msg, "\n") + _vert = " $vert " + vert_width = textlen(_vert) for n in 2:length(msg_lines) - msg_lines[n] = - " $vert " * " "^(textlen(content) - 4) * "{$logmsg_color}" * msg_lines[n] + # make sure the text fits in the given space + txt = RenderableText( + reshape_text(msg_lines[n], console_width() - vert_width - 1); + style = logmsg_color, + ) + v = join(repeat([_vert], height(txt)), "\n") + tprint(v * txt; highlight = false) end - length(msg_lines) > 0 && (content *= " " * msg_lines[1]) - - tprintln(content; highlight = false) - tprintln.(msg_lines[2:end]; highlight = false) - + # --------------------------------- contents --------------------------------- # # if no kwargs we can just quit if length(kwargs) == 0 || length(msg_lines) == 0 print_closing_line(color) return nothing end - # get padding width - _types = string.(typeof.(collect(values(kwargs)))) - _types = map(t -> ltrim_str(t, 22), _types) - for (i, _type) in enumerate(values(kwargs)) - typeof(_type) <: Function && (_types[i] = string(Function)) - end + """ + For each kwarg, get the type and the content, as string. + Optionally trim these strings to ensure formatting is fine. + """ + + # function to reshape all content appropriately + w = min(120, (Int ∘ round)((console_width() - 6) / 5) - 1) # six to allow space for vert and = + fmt_str(x, style; f = 1) = RenderableText(string(x); width = f * w - 1, style = style) + fmt_str(::Function, style; f = 1) = RenderableText("Function"; style = style) + + # get types, keys and values as RenderableText with style + ks = map(k -> fmt_str(k, logger.theme.text_accent), keys(kwargs)) + + _types = map(t -> t isa Function ? Function : typeof(t), (collect(values(kwargs)))) + _types = map(t -> fmt_str("$t::", "dim " * logger.theme.type), _types) + + vals = map(v -> style_log_msg_kw_value(logger, v), collect(values(kwargs))) + vals_style = [x[2] for x in vals] + vv = first.(vals) + vals = map(i -> fmt_str(vv[i], vals_style[i]; f = 3), 1:length(vv)) - wpad = maximum(textlen.(_types)) + 2 - ks = str_trunc.(string.(keys(kwargs)), 28) - namepad = maximum(textlen.(ks)) + # get the ma width of each piece of content + type_w = min(maximum(width.(_types)), w) + keys_w = min(maximum(width.(ks)), w) + vals_w = min(maximum(width.(vals)), 2w) # print all kwargs + eq = "{$(logger.theme.operator)}={/$(logger.theme.operator)}" tprintln(" $vert"; highlight = false) - for (k, v, _type) in zip(ks, values(kwargs), _types) - # get line stub - pad = wpad - textlen(_type) - 1 - line = - " $vert" * - " "^pad * - " {$(logger.theme.type) dim}($(_type)){/$(logger.theme.type) dim}" * - " {bold $(logger.theme.text)}$k{/bold $(logger.theme.text)}" - - epad = namepad - textlen(string(k)) - line *= - " "^epad * " {bold $(logger.theme.operator)}={/bold $(logger.theme.operator)} " - lpad = textlen(line) - 4 - - # get value style - if v isa Number - _style = logger.theme.number - elseif v isa Symbol - _style = logger.theme.symbol - elseif v isa AbstractString - _style = logger.theme.string - elseif v isa AbstractVector - _style = logger.theme.number - _size = length(v) - v = escape_brackets(string(v)) - v = textlen(v) > 33 ? v[1:30] * "..." : v - v *= "\n {$(logger.theme.text)}$(_size) {/$(logger.theme.text)}{dim}items{/dim}" - elseif v isa AbstractArray || v isa AbstractMatrix - _style = logger.theme.number - _size = size(v) - v = ltrim_str("$(typeof(v)) {dim}<: $(supertypes(typeof(v))[end-1]){/dim}", 30) - v *= - "\n {dim}shape: {default $(logger.theme.text)}" * - join(string.(_size), " × ") * - "{/default $(logger.theme.text)}{/dim}" - - elseif v isa Function - _style = logger.theme.func - elseif v isa AbstractRenderable - _style = "default" - v = "$(typeof(v)) \e[2m(size: $(v.measure))\e[0m" - else - _style = nothing - end + for (t, k, v) in zip(_types, ks, vals, _types) + # get the height of the tallest piece of content on this line + h = maximum(height.([k, v, t])) - # print value lines - try - v = reshape_text(ltrim_str(string(v), 177), 60) - catch - v = ltrim_str(string(v), 60) - end - vlines = split(v, "\n") + # make sure all renderables have the same height and each columns' renderable has the right width + t = vertical_pad(pad(t; width = type_w, method = :left); height = h, method = :top) + k = vertical_pad(pad(k; width = keys_w, method = :left); height = h, method = :top) + v = vertical_pad(pad(v; width = vals_w, method = :right); height = h, method = :top) - vlines = if !isnothing(_style) - map(ln -> "{" * _style * "}" * ln * "{/" * _style * "}", vlines) - else - highlight.(vlines) - end + # make vertical line and = + line = join(repeat([" $vert"], h), "\n") + equal = vertical_pad(eq, h, :top) - tprintln(line * vlines[1]; highlight = false) - if length(vlines) ≥ 1 - for ln in vlines[2:end] - tprintln(" $vert " * " "^lpad * ln; highlight = false) - end - end + hstack(line, t, k, equal, v; pad = 1) |> tprint end return print_closing_line(color) end @@ -320,7 +322,6 @@ function install_term_logger(theme::Theme = TERM_THEME[]) end function uninstall_term_logger() - _lg = global_logger(DEFAULT_LOGGER) logger = global_logger(DEFAULT_LOGGER) return logger end diff --git a/src/markdown.jl b/src/markdown.jl index 98730c4e3..b41a6d070 100644 --- a/src/markdown.jl +++ b/src/markdown.jl @@ -6,7 +6,12 @@ import OrderedCollections: OrderedDict import UnicodeFun: to_latex import Term: - reshape_text, highlight_syntax, fillin, escape_brackets, default_width, TERM_THEME + reshape_text, + highlight_syntax, + escape_brackets, + default_width, + TERM_THEME, + reshape_code_string import ..Tables: Table import ..Style: apply_style import ..Layout: pad, hLine, vLine @@ -163,7 +168,7 @@ function parse_md( lpad = true, kwargs..., )::String - syntax = highlight_syntax(code.code) + syntax = reshape_code_string(highlight_syntax(code.code), width - 20) theme = TERM_THEME[] if inline return "{$(theme.md_code)}`$(code.language){/$(theme.md_code)}" * diff --git a/src/measures.jl b/src/measures.jl index b28da977c..4cc8c6550 100644 --- a/src/measures.jl +++ b/src/measures.jl @@ -1,6 +1,6 @@ module Measures -import Term: rint, remove_ansi, remove_markup, default_width, DEFAULT_ASPECT_RATIO +import Term: rint, remove_ansi, remove_markup, default_width, DEFAULT_ASPECT_RATIO, textlen export Measure @@ -29,9 +29,9 @@ default_size() = (rint(default_width() / 2DEFAULT_ASPECT_RATIO[]), default_width Constructs a measure object from a string """ function Measure(str::AbstractString) - str = (remove_ansi ∘ remove_markup)(str) + str = remove_markup(remove_ansi(str); remove_orphan_tags = false) lines = split(str, '\n') - return Measure(length(lines), maximum(textwidth.(lines))) + return Measure(length(lines), maximum(textlen.(lines; remove_orphan_tags = false))) end Measure(::Nothing) = Measure(0, 0) diff --git a/src/panels.jl b/src/panels.jl index c1da04e2c..37cf9f13e 100644 --- a/src/panels.jl +++ b/src/panels.jl @@ -1,14 +1,7 @@ module Panels import Term: - join_lines, - fillin, - ltrim_str, - default_width, - remove_ansi, - get_bg_color, - textlen, - TERM_THEME + join_lines, ltrim_str, default_width, remove_ansi, get_bg_color, textlen, TERM_THEME import ..Renderables: AbstractRenderable, RenderablesUnion, Renderable, RenderableText import ..Layout: pad, vstack, Padding, lvstack @@ -189,12 +182,14 @@ end Convert any input content to a renderable """ -content_as_renderable(content, width, Δw, justify, background) = RenderableText( - string(content), - width = width - Δw, - background = background, - justify = justify, -) +content_as_renderable( + content, + width::Int, + Δw::Int, + justify::Symbol, + background::Union{String,Nothing}, +)::RenderableText = + RenderableText(content, width = width - Δw, background = background, justify = justify) """ --- @@ -228,6 +223,7 @@ function Panel( Δh = padding.top + padding.bottom # create content + # @info "panel fit" width height Δw Δh content = content_as_renderable(content, width, Δw, justify, background) # estimate panel size @@ -285,6 +281,7 @@ function Panel( content = content_as_renderable(content, width, Δw, justify, background) height = something(height, content.measure.h + Δh + 2) panel_measure = Measure(height, width) + # @info "panel nofit" width Δw Δh height panel_measure # if the content is too tall, exclude some lines if content.measure.h > height - Δh - 2 @@ -331,7 +328,7 @@ Panel(renderables::Vector{RenderablesUnion}; kwargs...) = Panel(vstack(renderables...); kwargs...) Panel(texts::Vector{AbstractString}; kwargs...) = Panel(join_lines(texts); kwargs...) -Panel(ren; kwargs...) = Panel(ren; kwargs...) +Panel(ren::Vector; kwargs...) = Panel(vstack(ren); kwargs...) Panel(ren, renderables...; kwargs...) = Panel(vstack(ren, renderables...); kwargs...) # ---------------------------------- render ---------------------------------- # @@ -342,26 +339,18 @@ Panel(ren, renderables...; kwargs...) = Panel(vstack(ren, renderables...); kwarg Create a Panel's content line. """ function makecontent_line( - cline, - panel_measure, - justify, - background, - padding, - left, - right, - Δw, + cline::Segment, + panel_measure::Measure, + justify::Symbol, + background::Union{Nothing,String}, + padding::Padding, + left::String, + right::String, + Δw::Int, )::Segment - line = apply_style(cline) |> rstrip - line = if panel_measure.w - textlen(line) ≥ 2 - pad(cline, panel_measure.w - Δw, justify; bg = background) - else - line * " " - end - + line = pad(cline, panel_measure.w - Δw, justify, ; bg = background).text line = pad(line, padding.left, padding.right; bg = background) - - # make line - return Segment(left * line * right) + return Segment(typeof(cline.text)(left * line * right)) end """ @@ -387,7 +376,7 @@ end Construct a `Panel`'s content. """ function render( - content; + content::Union{Renderable,RenderableText}; box::Symbol = TERM_THEME[].box, style::String = TERM_THEME[].line, title::Union{String,Nothing} = nothing, @@ -402,12 +391,11 @@ function render( Δw::Int, Δh::Int, padding::Padding, - background = nothing, + background::Union{Nothing,String} = nothing, kwargs..., )::Panel background = get_bg_color(background) - # @debug "calling render" content content_measure background - # println("Content\n", content) + # @info "calling render" content content_measure background # create top/bottom rows with titles box = BOXES[box] # get box object from symbol @@ -459,7 +447,7 @@ function render( content_sgs::Vector{Segment} = if content.measure.w > 0 map( s -> makecontent_line( - s.text, + s, panel_measure, justify, background, diff --git a/src/prompt.jl b/src/prompt.jl new file mode 100644 index 000000000..75649b885 --- /dev/null +++ b/src/prompt.jl @@ -0,0 +1,294 @@ +""" + module Prompts + +Defines functionality relative to prompts in the terminal. +Typically a prompt is composed of a piece of text that gets displayed prompting +the user to provide an input and some machinery to parse/validate the user's inputs. +For example, some prompts may only accept as replies objects of a given type (e.g. an `Int`). +Additionally, some prompts will have "options" the user can choose between and the answer +has to be one of these options. +""" +module Prompts + +import Term +import Term: highlight, TERM_THEME +import ..Style: apply_style +import ..Tprint: tprint, tprintln +import ..Repr: @with_repr, termshow + +export Prompt, TypePrompt, OptionsPrompt, DefaultPrompt, confirm, ask + +""" +Prompts in VSCODE require a bit of a hack: +https://discourse.julialang.org/t/vscode-errors-with-user-input-readline/75097/4?u=fedeclaudi + +When the text is displayed, the user should input "space" and a new line before inputting the +actual reponse. This is not a Term.jl problem. +""" + +# ------------------------------ abstract prompt ----------------------------- # + +""" Prompt types """ +abstract type AbstractPrompt end + +_print_prompt_text(io::IO, prompt::AbstractPrompt) = + tprintln(io, "{$(prompt.style)}{dim}❯❯❯ {/dim}" * prompt.prompt * "{/$(prompt.style)}") + +""" + Base.print(io::IO, prompt::AbstractPrompt) + +Default prompt printing, just prints the message `prompt` +with a bit of style. +""" +Base.print(io::IO, prompt::AbstractPrompt) = _print_prompt_text(io, prompt) + +""" + ask + +Ask does three things: + 1. displays a prompt + 2. accepts user input and validates it + 3. if the answer was accepted, returns the desired value. +""" +function ask end + +""" + ask(io::IO, prompt::AbstractPrompt) + +Default `ask` method for generic prompt objects. +""" +function ask(io::IO, prompt::AbstractPrompt) + print(io, prompt) + ans = readline() + return validate_answer(ans, prompt) +end + +ask(prompt::AbstractPrompt) = ask(stdout, prompt) + +""" + validate_answer + +Validate user's answer for a prompt type. +The validation mechanism depends on the type of prompt. +Validate answer will return the answer if it passed validation +or raise and error otherwise. +""" +function validate_answer end + +# -------------------------- answer validation error ------------------------- # + +""" + AnswerValidationError <: Exception + +Exception to handle cases in which the user's answer to a +prompt failed to pass validation. +""" +struct AnswerValidationError <: Exception + answer_type + expected_type + err +end + +Base.showerror(io::IO, e::AnswerValidationError) = print( + io, + highlight( + "TypePrompt expected an answer of type: `$(e.expected_type)`, got `$(e.answer_type)` instead\nConversion to `$(e.expected_type)` failed because of: $(e.err)", + ) |> apply_style, +) + +# ---------------------------------------------------------------------------- # +# PROMPT # +# ---------------------------------------------------------------------------- # + +""" + struct Prompt{T} <: AbstractPrompt + prompt::String + style::String = TERM_THEME[].prompt_text + end + +Generic prompt, accepts any answer +""" +@with_repr struct Prompt <: AbstractPrompt + prompt::String + style::String +end +Prompt(prompt::String) = Prompt(prompt, TERM_THEME[].prompt_text) + +validate_answer(ans, ::Prompt) = ans + +# ---------------------------------------------------------------------------- # +# TYPE PROMPT # +# ---------------------------------------------------------------------------- # + +""" + struct TypePrompt{T} + answer_type::Union{Union, DataType} = T + prompt::String + end + +Asks for input given `prompt` and checks/converts the answer to type `T` +""" +struct TypePrompt{T} <: AbstractPrompt + answer_type::T + prompt::String + style::String +end + +TypePrompt(answer_type, prompt::String) = + TypePrompt(answer_type, prompt, TERM_THEME[].prompt_text) + +""" + validate_answer(answer, prompt::TypePrompt) + +For a TypePrompt an anwer is valid if it is of the correct type +or if a string containg the answer can be parsed as the correct type. +For example, `answer="1.0"` can be accepted for a TypePrompt +asking for a `Number`. +If validation fails, an error is raised. +""" +function validate_answer(answer, prompt::TypePrompt) + answer isa prompt.answer_type && return answer + + err = nothing + try + return parse(prompt.answer_type, answer) + catch err + end + throw( + AnswerValidationError(typeof(answer), prompt.answer_type, apply_style(string(err))), + ) +end + +# ---------------------------------------------------------------------------- # +# OPTIONS PROMPTS # +# ---------------------------------------------------------------------------- # +""" Prompt types where user can only choose among options """ +abstract type AbstractOptionsPrompt <: AbstractPrompt end + +""" + struct OptionsPrompt <: AbstractOptionsPrompt + options::Vector{String} + prompt::String + style::String + answers_style::String + end + +Just a simple prompt, giving some pre-defined options. +""" +@with_repr struct OptionsPrompt <: AbstractOptionsPrompt + options::Vector{String} + prompt::String + style::String + answers_style::String +end + +OptionsPrompt(options, prompt::String) = + OptionsPrompt(options, prompt, TERM_THEME[].prompt_text, TERM_THEME[].prompt_options) + +""" + Base.print(io::IO, prompt::AbstractOptionsPrompt) + +Options prompts additionally print the available options. +""" +function Base.print(io::IO, prompt::AbstractOptionsPrompt) + _print_prompt_text(io, prompt) + tprint( + io, + " {$(prompt.answers_style)}" * + join(prompt.options, " {$(prompt.style)}/{/$(prompt.style)} ") * + "{/$(prompt.answers_style)}"; + highlight = false, + ) +end + +""" + validate_answer(answer, prompt::AbstractOptionsPrompt) + +For an AbstractOptionsPrompt an answer is accepted if its one of the options. +Additionally, for an `AbstractDefaultPrompt`, if no answer is given that's +also accepted and the default option is returned. +""" +function validate_answer(answer, prompt::AbstractOptionsPrompt) + (prompt isa AbstractDefaultPrompt && strip(answer) == "") && + return prompt.options[prompt.default] + strip(answer) ∉ prompt.options && begin + tprintln("{dim}Answer `$(answer)` is not valid.{/dim}") + return nothing + end + return answer +end + +""" + ask(io::IO, prompt::AbstractOptionsPrompt) + +In asking an `AbstractOptionsPrompt`, keep asking for input +until an accepted answer is provided. +""" +function ask(io::IO, prompt::AbstractOptionsPrompt) + ans = nothing + while isnothing(ans) + println(io, prompt) + ans = validate_answer(readline(), prompt) + end + return ans +end + +# ---------------------------------------------------------------------------- # +# DEFAULT PROMPT # +# ---------------------------------------------------------------------------- # + +""" Options prompt types with a default answer """ +abstract type AbstractDefaultPrompt <: AbstractOptionsPrompt end + +""" + +""" +@with_repr struct DefaultPrompt <: AbstractDefaultPrompt + options::Vector{String} + default::Int + prompt::String + style::String + answers_style::String + default_answer_style::String + + function DefaultPrompt(options::Vector, default::Int, prompt::String, args...) + @assert default > 0 && default < length(options) "Default answer number: $default not valid" + new(options, default, prompt, args...) + end +end + +function DefaultPrompt(options::Vector, default::Int, prompt::String) + DefaultPrompt( + options, + default, + prompt, + TERM_THEME[].prompt_text, + TERM_THEME[].prompt_options, + TERM_THEME[].prompt_default_option, + ) +end + +""" + Base.print(io::IO, prompt::AbstractDefaultPrompt) + +Print a prompt with style applied to the default option. +""" +function Base.print(io::IO, prompt::AbstractDefaultPrompt) + n_options = length(prompt.options) + _print_prompt_text(io, prompt) + answer_styles = map( + i -> i == prompt.default ? prompt.default_answer_style : prompt.answers_style, + 1:n_options, + ) + options = join( + (map( + i -> "{$(answer_styles[i])}$(prompt.options[i]){/$(answer_styles[i])}", + 1:n_options, + )), + ", ", + ) + tprint(io, " " * options) +end + +confirm() = ask(DefaultPrompt(["yes", "no"], 1, "Confirm?")) +end diff --git a/src/renderables.jl b/src/renderables.jl index c2d7dad2c..8d9edbed1 100644 --- a/src/renderables.jl +++ b/src/renderables.jl @@ -4,7 +4,6 @@ import Term: split_lines, reshape_text, ltrim_str, - fillin, join_lines, unescape_brackets_with_space, DEBUG_ON, @@ -18,7 +17,7 @@ import Term: highlight as highlighter import ..Consoles: console_width import ..Measures: Measure import ..Measures: width as get_width -import ..Segments: Segment +import ..Segments: Segment, get_string_types import ..Style: apply_style, MarkupStyle, get_style_codes export AbstractRenderable, Renderable, RenderableText @@ -40,23 +39,14 @@ info(r::AbstractRenderable)::String = Creates a string representation of a renderable """ -Base.string(r::AbstractRenderable)::String = return if isnothing(r.segments) - "" -else - join(map(seg -> seg.text, r.segments), "\n") +function Base.string(r::AbstractRenderable) + isnothing(r.segments) && return "" + seg_texts = getfield.(r.segments, :text) + stype = get_string_types(r.segments) + return join(seg_texts, "\n") |> stype end -#= -function Base.string(renderable::AbstractRenderable, width::Int)::String - isnothing(renderable.measure) && return string(renderable) - return if renderable.measure.w <= width - string(renderable) - else - # string(trim_renderable(renderable, width)) * "\e[0m" - string(RenderableText(string(renderable), width = width)) - end -end -=# +Base.String(r::AbstractRenderable) = Base.string(r) """ print(io::IO, renderable::AbstractRenderable) @@ -101,8 +91,6 @@ mutable struct Renderable <: AbstractRenderable measure::Measure end -Base.convert(::Renderable, x) = Renderable(x) - """ Renderable( str::String; width::Union{Nothing,Int} = nothing @@ -128,7 +116,7 @@ See also [`Renderable`](@ref), [`TextBox`](@ref) """ mutable struct RenderableText <: AbstractRenderable - segments::Vector + segments::Vector{Segment} measure::Measure style::Union{Nothing,String} end @@ -148,10 +136,9 @@ function RenderableText( background::Union{Nothing,String} = nothing, justify::Symbol = :left, ) - # @info "Construcing RenderableText" text width - # reshape text - text = apply_style(text) + stype::DataType = typeof(text) text = text_to_width(text, width, justify; background = background) |> chomp + text = apply_style(text) style = isnothing(style) ? "" : style background = isnothing(background) ? "" : get_bg_color(background) @@ -159,9 +146,9 @@ function RenderableText( style_init, style_finish = get_style_codes(MarkupStyle(style)) - segments = map(ln -> Segment(style_init * ln * style_finish), split(text, "\n")) + segments = map(ln -> Segment(stype(style_init * ln * style_finish)), split(text, "\n")) - return RenderableText(segments, Measure(segments), style) + return RenderableText(segments::Vector{Segment}, Measure(segments), style::String) end """ @@ -173,6 +160,7 @@ function RenderableText( rt::RenderableText; style::Union{Nothing,String} = nothing, width::Int = console_width(), + kwargs..., ) return if rt.style == style && rt.measure.w == width rt @@ -182,6 +170,22 @@ function RenderableText( end end +function RenderableText( + ren::AbstractRenderable, + args...; + width = console_width(), + kwargs..., +) + if ren.measure.w <= width + return RenderableText(ren.segments, ren.measure, nothing) + else + lines = getfield.(ren.segments, :text) + # texts = map(l -> RenderableText(l, args...; width=width, kwargs...), lines) + # return foldl(/, texts) + return RenderableText(join(lines, "\n"), args...; width = width, kwargs...) + end +end + # ---------------------------------------------------------------------------- # # MISC. # # ---------------------------------------------------------------------------- # @@ -192,14 +196,12 @@ end Trim a string or renderable to a max width. """ function trim_renderable(ren::AbstractRenderable, width::Int)::AbstractRenderable - # @info "Trimming renderable" ren text = getfield.(ren.segments, :text) segs = Segment.(map(s -> get_width(s) > width ? str_trunc(s, width) : s, text)) return Renderable(segs, Measure(segs)) end function trim_renderable(ren::RenderableText, width::Int)::RenderableText - # @info "Trimming text renderable" ren text = join(getfield.(ren.segments, :text)) return RenderableText(text, width = width) end diff --git a/src/repr.jl b/src/repr.jl index 551fa7cfb..3695e650c 100644 --- a/src/repr.jl +++ b/src/repr.jl @@ -12,7 +12,10 @@ import Term: split_lines, TERM_THEME, default_width, - plural + plural, + reshape_text, + remove_markup, + reshape_code_string import ..Layout: vLine, rvstack, lvstack, Spacer, vstack, cvstack, hLine, pad import ..Renderables: RenderableText, info, AbstractRenderable diff --git a/src/segments.jl b/src/segments.jl index edf85c739..4ebd71385 100644 --- a/src/segments.jl +++ b/src/segments.jl @@ -19,7 +19,7 @@ export Segment stores one piece of text with all the styles applied to it. """ struct Segment - text::String # text with ANSI codes injected + text::AbstractString # text with ANSI codes injected measure::Measure # measure of plain text end @@ -46,27 +46,12 @@ Segment(text, markup::String) = Segment("{$markup}" * text * "{/$markup}") Base.show(io::IO, seg::Segment) = print(io, unescape_brackets(seg.text)) Base.show(io::IO, ::MIME"text/plain", seg::Segment) = - print(io, "Segment \e[2m(size: $(seg.measure))\e[0m") + print(io, "Segment{$(typeof(seg.text))} \e[2m(size: $(seg.measure))\e[0m") # ---------------------------------------------------------------------------- # # LAYOUT # # ---------------------------------------------------------------------------- # -""" - Term.fillin(segments::Vector{Segment})::Vector{Segment} - -Ensure that for each segment the text has the same width -""" -function Term.fillin(segments::Vector{Segment})::Vector{Segment} - w = maximum(width.(segments)) - - filled::Vector{Segment} = [] - for seg in segments - push!(filled, Segment(seg.text * " "^(w - seg.measure.w))) - end - return filled -end - # -------------------------------- concatenate ------------------------------- # """ concatenate strings and segments @@ -75,4 +60,22 @@ Base.:*(seg::Segment, str::AbstractString) = Segment(seg.text * str) Base.:*(str::AbstractString, seg::Segment) = Segment(str * seg.text) Base.:*(seg1::Segment, seg2::Segment) = Segment(seg1.text * seg2.text) +# ------------------------------- string types ------------------------------- # + +""" + get_string_types(segments_vectors...) + +Given a number of `Segment[]` vectors, get the `AbstractString` like +type they're using. If they are all using normal `String` or `Substring` +go with that, but if one of them is using a different string type, use it. +""" +function get_string_types(segments_vectors...)::DataType + stypes::Vector{DataType} = + vcat(map(segments -> getfield.(segments, :text), segments_vectors)...) .|> + typeof |> + unique + + stypes = setdiff(stypes, [String, SubString]) + return length(stypes) == 0 ? String : stypes[1] +end end diff --git a/src/style.jl b/src/style.jl index 7d5e65143..c37ad7595 100644 --- a/src/style.jl +++ b/src/style.jl @@ -8,11 +8,11 @@ import Term: has_markup, OPEN_TAG_REGEX, replace_text, - get_last_ANSI_code, CODES, ANSICode, tview, - do_by_line + do_by_line, + ANSI_REGEX import ..Colors: AbstractColor, NamedColor, is_color, is_background, get_color, is_hex_color, hex2rgb @@ -26,8 +26,6 @@ apply_style(text::String, style::String) = apply_style("{" * style * "}" * text * "{/" * style * "}") end -apply_style(c::Char, style::String) = apply_style(string(c), style) - """ Check if a string is a mode name """ @@ -126,44 +124,101 @@ Apply style to a piece of text. Extract markup style information and insert the appropriate ANSI codes to style a string. + +When multiple, nested color tags are present, like in" + "{red} abcd {green} asd {/green} eadsa {/red}" +extra care should be put to ensure that when `green` is closed +the text is rendered as red. To this end, this function +keeps track of the last color style information and where it occurred in the input +text. If the current markup tag is nested in the previous, it changes, for example + "{/green}" +to + "{/green}{red}". +The same in parallel has to be done for background colors. + +By default, "orphaned" tags (i.e. open/close markup tags without the corresponding +tag) are removed from the string. Use `leave_orphan_tags` to change this behavior. """ -function apply_style(text)::String +function apply_style(text; leave_orphan_tags = false)::String has_markup(text) || return text + previous_color = (0, length(text), MarkupStyle("default")) + previous_background = (0, length(text), MarkupStyle("default")) while has_markup(text) # get opening markup tag open_match = match(OPEN_TAG_REGEX, text) markup = open_match.match[2:(end - 1)] # get style codes - ansi_open, ansi_close = get_style_codes(MarkupStyle(markup)) - - # replace markup with ANSI codes - text = replace_text( - text, - max(open_match.offset - 1, 0), - open_match.offset + length(markup) + 1, - ansi_open, - ) + ms = MarkupStyle(markup) + ansi_open, ansi_close = get_style_codes(ms) + + # insert open tag + if ansi_open == "" && ansi_close == "" && leave_orphan_tags + # found an invalid tag (e.g. {string}). Leave it but edit it to avoid getting stuck in this lookup + # replace markup with ANSI codes + text = replace_text( + text, + max(open_match.offset - 1, 0), + open_match.offset + length(markup) + 1, + "{{" * markup * "}}", + ) + else + # replace markup with ANSI codes + text = replace_text( + text, + max(open_match.offset - 1, 0), + open_match.offset + length(markup) + 1, + ansi_open, + ) + end # get closing tag (including [/] or missing close) close_rx = r"(? previous_color[1] && + close_match.offset < previous_color[2] && + !isnothing(previous_color[3].color) + col_prev_ansi_open, _ = get_style_codes(previous_color[3]) + ansi_close = ansi_close * col_prev_ansi_open + end + + # and for background + if open_match.offset > previous_background[1] && + close_match.offset < previous_background[2] && + !isnothing(previous_background[3].background) + bg_prev_ansi_open, _ = get_style_codes(previous_background[3]) + ansi_close = ansi_close * bg_prev_ansi_open + end # replace close tag text = replace_text( text, close_match.offset - 1, close_match.offset + length(markup) + 2, - ansi_close * prev_style, + ansi_close, + ) + + # store style info + isnothing(ms.color) || ( + previous_color = ( + max(open_match.offset - 1, 0), + close_match.offset + length(markup) + 2, + ms, + ) + ) + + isnothing(ms.background) || ( + previous_background = ( + max(open_match.offset - 1, 0), + close_match.offset + length(markup) + 2, + ms, + ) ) end return text diff --git a/src/tables.jl b/src/tables.jl index 9b2e81988..0b3ba8b45 100644 --- a/src/tables.jl +++ b/src/tables.jl @@ -168,7 +168,7 @@ function Table( # get the height of each row heights = rows_heights(N_rows, show_header, header, rows_values, footer, vpad) - # @info "sizes" widths heights + # @info "sizes" widths heights tb sch # ----------------------------- create table rows ---------------------------- # nrows = length(rows_values) diff --git a/src/theme.jl b/src/theme.jl index eafd57f2d..5760510a3 100644 --- a/src/theme.jl +++ b/src/theme.jl @@ -24,6 +24,7 @@ style outputs to terminal. number::String = blue_light operator::String = red func::String = "#f2d777" + link::String = "underline $(light_blue_light)" # misc text::String = "default" @@ -41,11 +42,15 @@ style outputs to terminal. logmsg::String = "#8abeff" # tree - tree_title::String = "$orange italic" - tree_node::String = "$yellow italic" - tree_leaf::String = yellow_light - tree_guide::String = blue - tree_max_width::Int = 44 + tree_mid::String = blue + tree_terminator::String = blue + tree_skip::String = blue + tree_dash::String = blue + tree_trunc::String = blue + tree_pair::String = red_light + tree_keys::String = yellow + tree_title::String = "bold " * orange + tree_max_leaf_width::Int = 44 # repr repr_accent::String = "bold #e0db79" @@ -104,11 +109,28 @@ style outputs to terminal. # table tb_style::String = "#9bb3e0" tb_header::String = "bold white" - tb_columns::String = "defualt" + tb_columns::String = "default" tb_footer::String = "default" tb_box::Symbol = :MINIMAL_HEAVY_HEAD + + # prompt + prompt_text::String = blue + prompt_default_option::String = "underline bold $green" + prompt_options::String = "default" + + # annotations + annotation_color::String = blue_light end +(t::Theme)(::Function) = t.func +(t::Theme)(::Number) = t.number +(t::Theme)(::Union{UnionAll,DataType}) = t.type +(t::Theme)(::Symbol) = t.symbol +(t::Theme)(::Expr) = t.expression +(t::Theme)(::AbstractVector) = t.number +(t::Theme)(::Any) = t.text + +# ---------------------------------- themes ---------------------------------- # DarkTheme = Theme(name = "dark") LightTheme = Theme( @@ -141,10 +163,14 @@ LightTheme = Theme( logmsg = "#8abeff", # tree - tree_title = "$orange italic", - tree_node = "$yellow_darker italic", - tree_leaf = yellow_dark, - tree_guide = blue_darker, + tree_mid = blue_darker, + tree_terminator = blue_darker, + tree_skip = blue_darker, + tree_dash = blue_darker, + tree_trunc = blue_darker, + tree_pair = red_light, + tree_keys = red_dark, + tree_max_leaf_width = 44, # repr repr_accent = "bold $yellow_darker", diff --git a/src/tprint.jl b/src/tprint.jl index 2a904b32b..4f6e58886 100644 --- a/src/tprint.jl +++ b/src/tprint.jl @@ -25,9 +25,6 @@ tprint(x; highlight = true) = tprint(stdout, x; highlight = highlight) tprint(io::IO, x; highlight = true) = tprint(io, string(x); highlight = highlight) -tprint(io::IO, ::MIME"text/html", x; highlight = true) = - tprint(io, x; highlight = highlight) - """ --- tprint(x::AbstractString) @@ -54,16 +51,14 @@ Equivalent to `print(x)` function tprint(io::IO, x::AbstractRenderable; highlight = true) w = console_width() x = x.measure.w > console_width() ? trim_renderable(x, w) : x - print(io, x; highlight = highlight) + print(io, x) end -function tprint(io::IO, args...) +function tprint(io::IO, args...; highlight = true) for (n, arg) in enumerate(args) - tprint(io, arg) + tprint(io, arg; highlight = highlight) - if n < length(args) - args[n + 1] isa AbstractRenderable || print(io, " ") - end + (n < length(args) && args[n + 1] isa AbstractRenderable) || print(io, " ") end return nothing end @@ -88,5 +83,7 @@ styling functionality. """ tprintln(args...; highlight = true) = tprint(args..., "\n"; highlight = highlight) +tprintln(io::IO, args...; highlight = true) = + tprint(io, args..., "\n"; highlight = highlight) end diff --git a/src/trees.jl b/src/trees.jl index fd4d41115..10a095079 100644 --- a/src/trees.jl +++ b/src/trees.jl @@ -1,22 +1,11 @@ module Trees -import OrderedCollections: OrderedDict -import Base: @kwdef +import AbstractTrees: print_tree, TreeCharSet, children using InteractiveUtils -import Term: - loop_last, - escape_brackets, - fillin, - highlight, - rint, - TERM_THEME, - textlen, - str_trunc, - expr2string - -import ..Renderables: AbstractRenderable -import ..Layout: vstack, pad, hLine +import Term: replace_multi, highlight, reshape_text, TERM_THEME, Theme + +import ..Renderables: AbstractRenderable, RenderableText import ..Style: apply_style import ..Segments: Segment import ..Measures: Measure @@ -29,292 +18,157 @@ export Tree # ---------------------------------------------------------------------------- # treeguides = Dict( - :standardtree => (" ", "│ ", "├── ", "└── "), - :boldtree => (" ", "┃ ", "┣━━ ", "┗━━ "), - :asciitree => (" ", "| ", "+-- ", "`-- "), + :standardtree => TreeCharSet("├", "└", "│", "─", "⋮", " ⇒ "), + :roundedtree => TreeCharSet("├──", "╰─", "│", "─", "⋮", " ⇒ "), + :boldtree => TreeCharSet("┣━━", "┗━━", "┃", "━", "⋮", " ⇒ "), + :asciitree => TreeCharSet("+--", "`--", "|", "--", "...", " => "), ) -""" - TreeGuides - -Store strings to make up a `Tree`'s guides (the line elements showing connections). -""" -struct TreeGuides - space::String - vline::String - branch::String - leaf::String -end - -""" - TreeGuides(guides_type::Symbol, style::String) - -Get tree guides with style information applied -""" -TreeGuides(guides_type::Symbol, style::String) = - TreeGuides(map((g) -> apply_style("{$style}$g{/$style}"), treeguides[guides_type])...) - # ---------------------------------------------------------------------------- # # TREE # # ---------------------------------------------------------------------------- # -# ----------------------------------- leaf ----------------------------------- # +const _TREE_PRINTING_TITLE = Ref{Union{Nothing,String}}(nothing) """ - asleaf + print_node(io, node) -Style an object to render it as a a string +Core function to enable fancy tree printing. Styles the leaf/key of each node. """ -function asleaf end +function print_node(io, node; kw...) + theme::Theme = TERM_THEME[] + + if isnothing(_TREE_PRINTING_TITLE[]) # print node + styled = if node isa AbstractString + highlight(node, :string; theme = theme) + else + styled = highlight(string(node); theme = theme) + end + reshaped = reshape_text(styled, theme.tree_max_leaf_width) + print(io, reshaped) + else # print title + title = _TREE_PRINTING_TITLE[] + print(io, apply_style(title, theme.tree_title)) + end -asleaf(x) = str_trunc(highlight(string(x)), TERM_THEME[].tree_max_width) -asleaf(x::Nothing) = nothing -asleaf(x::AbstractVector) = str_trunc(string(x), TERM_THEME[].tree_max_width) -asleaf(x::AbstractString) = str_trunc(highlight(x, :string), TERM_THEME[].tree_max_width) + _TREE_PRINTING_TITLE[] = nothing +end """ - Leaf + print_key(io, k; kw...) -End items in a `Tree`. No sub-trees. +Print a tree's node's key with some style. """ -struct Leaf - name::Union{Nothing,String} - text::Union{Nothing,String} - idx::Int # rendering index +function print_key(io, k; kw...) + s = TERM_THEME[].tree_keys + print(io, apply_style("{s}" * string(k) * "{/s}")) end -# ----------------------------------- tree ----------------------------------- # """ - Tree + style_guides(tree::String, guides::TreeCharSet, theme::Theme) -A tree is composed of nodes (other trees) and leaves (end items). -It renders as a hierarchical structure with lines (guides) connecting the various elements +Apply style to a tree's guides by inserting it into its string representation. +Not ideal as it will affect the style of other elements with the same characters +like Panels, but ok for no. """ -@kwdef struct Tree <: AbstractRenderable - segments::Union{Nothing,Vector{Segment}} = nothing - measure::Measure = Measure(segments) - - name::String - level::Int - nodes::Vector{Tree} - leaves::Vector{Leaf} - idx::Int = 0 # rendering index for tree that are nodes in a lager tree - - title_style::String = TERM_THEME[].tree_title - node_style::String = TERM_THEME[].tree_node - leaf_style::String = TERM_THEME[].tree_leaf - guides_style::String = TERM_THEME[].tree_guide - guides_type::Symbol = :standardtree +function style_guides(tree::String, guides::TreeCharSet, theme::Theme) + return replace_multi( + tree, + guides.mid => apply_style(guides.mid, theme.tree_mid), + guides.terminator => apply_style(guides.terminator, theme.tree_terminator), + guides.skip => apply_style(guides.skip, theme.tree_skip), + guides.dash => apply_style(guides.dash, theme.tree_dash), + guides.trunc => apply_style(guides.trunc, theme.tree_trunc), + strip(guides.pair) => apply_style(string(strip(guides.pair)), theme.tree_pair), + ) end """ -Show/render a `Tree` + Tree + +Renderable tree. """ -function Base.show(io::IO, tree::Tree) - if io != stdout - print( - io, - "Tree: $(length(tree.nodes)) nodes, $(length(tree.leaves)) leaves | Idx: $(tree.idx)", - ) - else - println.(io, tree.segments) - end +struct Tree <: AbstractRenderable + segments::Vector{Segment} + measure::Measure end """ -Add a new node to an existing tree's nodes or levaes. -""" -function addnode!(nodes::Vector{Tree}, leaves::Vector{Leaf}, level, k, v::AbstractDict) - return push!( - nodes, - Tree( - v; - level = level + 1, - title = str_trunc(string(k), TERM_THEME[].tree_max_width), - idx = length(nodes) + length(leaves) + 1, - ), + Tree( + tree; + guides::Union{TreeCharSet,Symbol} = :standardtree, + theme::Theme = TERM_THEME[], + printkeys::Union{Nothing,Bool} = true, + print_node_function::Function = print_node, + print_key_function::Function = print_key, + title::Union{String, Nothing}=nothing, + prefix::String = " ", + kwargs..., ) -end -function addnode!(nodes::Vector{Tree}, leaves::Vector{Leaf}, level, k, v::Pair) - k = if isnothing(v.first) - nothing - else - str_trunc(string(v.first), TERM_THEME[].tree_max_width) - end - idx = length(nodes) + length(leaves) + 1 - return push!(leaves, Leaf(k, asleaf(v.second), idx)) -end +Constructor for `Tree` -function addnode!(nodes::Vector{Tree}, leaves::Vector{Leaf}, level, k, v::Any) - k = isnothing(k) ? nothing : str_trunc(string(k), TERM_THEME[].tree_max_width) - idx = length(nodes) + length(leaves) + 1 - return push!(leaves, Leaf(k, asleaf(v), idx)) -end +It uses `AbstractTrees.print_tree` to get a string representation of `tree` (any object +compatible with the `AbstractTrees` packge). Applies style to the string and creates a +renderable `Tree`. -function addnode!(nodes::Vector{Tree}, leaves::Vector{Leaf}, level, k, v::Vector) - for _v in v - _k = - _v isa Union{Dict,OrderedDict} ? collect(keys(_v))[1] : - (v isa Pair ? _v.first : v) - addnode!(nodes, leaves, level + 1, _k, _v) - end -end +Arguments: +- `tree`: anything compatible with `AbstractTree` +- `guides`: if a symbol, the name of preset tree guides types. Otherwise an instance of + `AbstractTrees.TreeCharSet` +- `theme`: `Theme` used to set tree style. +- `printkeys`: If `true` print keys. If `false` don't print keys. +- `print_node_function`: Function used to print nodes. +- `print_key_function`: Function used to print keys. +- `title`: Title of the tree. +- `prefix`: Prefix to be used in `AbstractTrees.print_tree` -""" - Tree(data::Union{AbstractDict, Pair}; level=0, title::String="tree", kwargs...) -Construct a `Tree` out of a `Dict` or `OrderedDict`. Recursively handle nested `Dict`s. +For other kwargs look at `AbstractTrees.print_tree` """ function Tree( - data::Union{AbstractDict,Pair,Vector}; - level = 0, - title::String = "tree", + tree; + guides::Union{TreeCharSet,Symbol} = :standardtree, + theme::Theme = TERM_THEME[], + printkeys::Union{Nothing,Bool} = true, + print_node_function::Function = print_node, + print_key_function::Function = print_key, + title::Union{String,Nothing} = nothing, + prefix::String = " ", kwargs..., ) - - # initialize - nodes::Vector{Tree} = [] - leaves::Vector{Leaf} = [] - - # go over all entries - for (k, v) in zip(keys(data), values(data)) - addnode!(nodes, leaves, level, k, v) - end - - # if we're handling the first tree, render it. Otherwise parse nested trees. - if level > 0 - # we don't need to render - return Tree(; - name = title, - level = level, - nodes = nodes, - leaves = leaves, - kwargs..., - ) - else - # render and get measure - segments = render( - Tree(; name = title, level = level, nodes = nodes, leaves = leaves, kwargs...), - ) - measure = Measure(segments) - - return Tree(; - segments = segments, - measure = measure, - name = str_trunc(title, TERM_THEME[].tree_max_width), - level = level, - nodes = nodes, - leaves = leaves, + _TREE_PRINTING_TITLE[] = title + + # print tree + guides = guides isa Symbol ? treeguides[guides] : guides + tree = sprint( + io -> print_tree( + print_node_function, + print_key_function, + io, + tree; + charset = guides, + printkeys = printkeys, + prefix = prefix, kwargs..., - ) - end -end - -# ---------------------------------- render ---------------------------------- # - -""" - render(tree::Tree)::Vector{Segment} - -Render a `Tree` into segments. Recursively handle nested trees. - - -""" -function render( - tree::Tree; - prevguides::String = "", - lasttree = false, - waslast = [], - guides = nothing, -)::Vector{Segment} - guides = isnothing(guides) ? TreeGuides(tree.guides_type, tree.guides_style) : guides - hasleaves = length(tree.leaves) > 0 - - segments::Vector{Segment} = [] - - """ - Add a segment to the segments vector - """ - _add(x::String, style) = push!(segments, Segment(x, style)) - _add(x::String) = _add(x, "default") - - # ------------------------------ render in parts ----------------------------- # - # render initial part - if tree.level == 0 - header_text = "{$(tree.title_style)}$(tree.name){/$(tree.title_style)}" - header = - (" " * header_text * " ") / - hLine(textlen(tree.name) + 2; style = "$(tree.title_style) dim", box = :HEAVY) - - append!(segments, header.segments) - else - _pre_guides = "" - for (n, (l, last)) in enumerate(loop_last(waslast)) - # ugly, get the correct sequence of guides based on where we are/what came before - if last - _end = lasttree ? guides.leaf : guides.branch - _pre_guides *= l ? _end : guides.space + ), + ) - else - _end = n == length(waslast) ? guides.branch : guides.vline - _pre_guides *= lasttree ? (l ? guides.leaf : guides.vline) : _end - end - end + # style keys + rx = Regex("(?<=$(guides.dash)) [\\w.,\":\\[\\]\\d]+ (?=$(strip(guides.pair)))") + tree = replace( + tree, + rx => SubstitutionString( + "{$(theme.tree_keys)}" * s"\g<0>" * "{/$(theme.tree_keys)}", + ), + ) - _add(_pre_guides * "{$(tree.node_style)}$(tree.name){/$(tree.node_style)}") - end - tree.level == 0 && _add(prevguides * guides.vline) - - # get all nodes and sub-trees in order for rendering - elements = vcat(tree.nodes, tree.leaves) - idxs = getfield.(elements, :idx) - elements = elements[sortperm(idxs)] - # @info "rendering $(length(elements)) elements" elements - - for (last, elem) in loop_last(elements) - if elem isa Tree - prev = prevguides * (last ? guides.space : guides.vline) - - append!( - segments, - render( - elem; - prevguides = prev, - lasttree = last, - waslast = vcat(waslast, last), # vcat(waslast, lasttree), - guides = guides, - ), - ) - # hasleaves && length(elem.leaves) > 0 && _add(prevguides * guides.vline) - elseif elem isa Leaf - # @info "rendering leaf $(elem.idx): $(elem.name) > $(elem.text)" - seg = last ? guides.leaf : guides.branch - if isnothing(elem.text) - k = isnothing(elem.name) ? "" : highlight(elem.name) - v = "" - else - k = if isnothing(elem.name) - "" - else - "{$(tree.leaf_style)}$(elem.name){/$(tree.leaf_style)}: " - end - v = elem.text - end - _add(prevguides * seg * k * v) - end - end + # style guides + tree = style_guides(tree, guides, theme) - # left pad segments - if tree.level == 0 - header_length = length(header.segments) - padded_segments = vcat( - header.segments..., - pad(segments[(header_length + 1):end], rint(header.measure.w / 2 - 1))..., - ) - return fillin(padded_segments) - else - return segments - end + # turn into a renderable + rt = RenderableText(tree) + return Tree(rt.segments, rt.measure) end # ---------------------------------------------------------------------------- # @@ -365,38 +219,27 @@ end Tree(T::DataType)::Tree Construct a `Tree` visualization of `T`'s types hierarchy +The key is in costructing the actual hierarchy tree recursively. """ function Tree(T::DataType)::Tree - theme = TERM_THEME[] # create a dictionary of types hierarchy subs = Dict(string(s) => nothing for s in subtypes(T)) data = make_hierarchy_dict(supertypes(T), T, subs) - return Tree( - data; - title = string(supertypes(T)[end - 1]), - # title = "Any", - title_style = "$(theme.emphasis_light) italic", - guides_style = theme.emphasis, - ) -end + # define a fn to avoid printing nodes + s = TERM_THEME[].tree_mid + fn(io::IO, x) = + length(children(x)) > 0 ? print(io, apply_style("{$s}┬{/$s}")) : print(io, "") -function _key(e::Expr) - if length(e.args) > 1 - "$(expr2string(e)) {dim $(TERM_THEME[].emphasis)}($(e.head): {/dim $(TERM_THEME[].emphasis)}{red bold default}$(e.args[1]){/red bold default}{dim blue}){/dim blue}" - else - string(e.head) - end -end -_values(e::Expr) = length(e.args) > 1 ? e.args[2:end] : e.args + # change style of pair + _style = TERM_THEME[].tree_pair + TERM_THEME[].tree_pair = "hidden" -_pair(x) = nothing => x -_pair(e::Expr) = Dict(_key(e) => _pair.(_values(e))) + # print tree + _tree = Tree(data; printkeys = true, print_node_function = fn) + TERM_THEME[].tree_pair = _style -function Tree(expr::Expr; kwargs...) - parsed = _pair(expr) - parsed = Dict(collect(keys(parsed))[1] => parsed) - return Tree(parsed; title = expr2string(expr)) + return _tree end end diff --git a/test/01_test_text_utils.jl b/test/01_test_text_utils.jl index b30630d30..e9a4158bb 100644 --- a/test/01_test_text_utils.jl +++ b/test/01_test_text_utils.jl @@ -1,13 +1,9 @@ import Term: - get_last_ANSI_code, unescape_brackets, - remove_brackets, escape_brackets, - get_ANSI_codes, unspace_commas, remove_markup, replace_text, - replace_ansi, reshape_text, remove_ansi, split_lines, @@ -15,12 +11,15 @@ import Term: has_markup, cleantext, textwidth, - nospaces, has_ansi, textlen, fillin, chars, - justify + justify, + str_trunc, + reshape_code_string + +import Term.Colors: nospaces import Term.Style: apply_style import Term.Measures: width as get_width @@ -45,6 +44,11 @@ import Term.Measures: width as get_width @test remove_markup("text with {{double}} squares") == "text with {{double}} squares" @test !has_markup("text with {{double}} squares") + + text = "{red}asdasda{/green}a{blue}sda{/blue}sda{/red}" + + @test remove_markup(text) == "asdasdaasdasda" + @test remove_markup(text; remove_orphan_tags = false) == "asdasda{/green}asdasda" end @testset "TU_ansi" begin @@ -70,8 +74,6 @@ end for (s1, s2, ltag) in strings @test has_ansi(s1) @test remove_ansi(s1) == s2 - @test get_last_ANSI_code(s1) == ltag - @test length(get_ANSI_codes(s1)) > 0 end end @@ -88,20 +90,10 @@ end @test replace_text(text, 10, 15, ',') == "abcdefghil,,,,,rstuvz" @test nospaces("a (1, 2, 3) 4") == "a(1,2,3)4" - @test remove_brackets("aaa (asdsd) BB") == "aaa asdsd BB" @test unspace_commas("a, 2, 3") == "a,2,3" end -@testset "TU_replace_ansi" begin - text = apply_style( - "Lorem {red}ipsum dolor sit {underline}amet, consectetur{/underline} adipiscing elit, {/red}{blue}sed do eiusmod tempor incididunt{/blue} ut labore et dolore magna aliqua.", - ) - - @test replace_ansi(text) == - "Lorem ¦¦¦¦¦ipsum dolor sit ¦¦¦¦amet, consectetur¦¦¦¦¦¦¦¦¦¦ adipiscing elit, ¦¦¦¦¦¦¦¦¦¦sed do eiusmod tempor incididunt¦¦¦¦¦ ut labore et dolore magna aliqua." -end - @testset "TU_misc" begin @test chars("abcd") == ['a', 'b', 'c', 'd'] @@ -118,136 +110,100 @@ asddsa""", end @testset "TU_reshape" begin - str = """ -Lorem ipsum {bold}dolor sit{/bold} amet, consectetur adipiscing elit, -ed do e{red}iusmod tempor incididunt{/red} ut {bold}labore et {underline}dolore{/underline} magna aliqua.{/bold} Ut enim ad minim -veniam, quis{green} nostrud exercitation {on_black}ullamco laboris nisi ut aliquip ex {/on_black} -ea commodo consequat.{blue} Duis aute irure dolor in{/blue} reprehenderit -in voluptate velit{/green} esse {italic}cillum dolore{/italic}{red} eu{/red}{italic green} fugiat {/italic green}nulla -pariatur. Excepteur{red} sint{/red}{blue} occaecat cupidatat {/blue}non proident, -sunt in culpa qui {italic}officia{/italic} deserunt mollit anim -id est laborum.""" - - str_reshaped = "Lorem ipsum {bold}dolor sit{/bold} amet,\nconsectetur adipiscing elit,\ned do e{red}iusmod tempor incididunt{/red}\nut {bold}labore et {underline}dolore{/underline} magna aliqua.\n{/bold} Ut enim ad minim\nveniam, quis{green} nostrud exercitation\n {on_black}ullamco laboris nisi ut aliquip\nex {/on_black}\nea commodo consequat.{blue} Duis aute\nirure dolor in{/blue} reprehenderit\nin voluptate velit{/green} esse {italic}cillum\ndolore{/italic}{red} eu{/red}{italic green} fugiat {/italic green}nulla\npariatur. Excepteur{red} sint{/red}{blue} occaecat\n cupidatat {/blue}non proident,\nsunt in culpa qui {italic}officia{/italic} deserun\nt mollit anim\nid est laborum." - - logo_str = """Term.jl is a {#9558B2}Julia{/#9558B2} package for creating styled terminal outputs. - - Term provides a simple {italic green4 bold}markup language{/italic green4 bold} to add {bold bright_blue}color{/bold bright_blue} and {bold underline}styles{/bold underline} to your text. - More complicated text layout can be created using {red}"Renderable"{/red} objects such - as {red}"Panel"{/red} and {red}"TextBox"{/red}. - These can also be nested and stacked to create {italic pink3}fancy{/italic pink3} and {underline}informative{/underline} terminal ouputs for your Julia code""" - - logo_str_reshaped = "Term.jl is a {#9558B2}Julia{/#9558B2} package for\ncreating styled terminal outputs.\n\nTerm provides a simple {italic green4 bold}markup\nlanguage{/italic green4 bold} to add {bold bright_blue}color{/bold bright_blue} and {bold underline}styles{/bold underline}\nto your text.\nMore complicated text layout\ncan be created using {red}\"Renderable\"\n{/red} objects such\nas {red}\"Panel\"{/red} and {red}\"TextBox\"{/red}.\nThese can also be nested and\nstacked to create {italic pink3}fancy{/italic pink3} and\n{underline}informative{/underline} terminal ouputs\nfor your Julia code" - strings = [ - ( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", - "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit,\nsed do eiusmod tempor incididunt\nut labore et dolore magna aliqua.", - ), - ( - "Lorem {red}ipsum dolor sit {underline}amet, consectetur{/underline} adipiscing elit, {/red}{blue}sed do eiusmod tempor incididunt{/blue} ut labore et dolore magna aliqua.", - "Lorem {red}ipsum dolor sit {underline}amet,\nconsectetur{/underline} adipiscing elit,\n{/red}{blue}sed do eiusmod tempor incididunt{/blue}\nut labore et dolore magna aliqua.", - ), - ( - "Lorem{red}ipsumdolorsit{underline}amet, consectetur{/underline} adipiscing elit, {/red}seddoeiusmo{blue}dtemporincididunt{/blue}ut labore et dolore magna aliqua.", - "Lorem{red}ipsumdolorsit{underline}amet, consectet\nur{/underline} adipiscing elit, {/red}seddoeiusmo{blue}dt\nemporincididunt{/blue}ut labore et\ndolore magna aliqua.", - ), - ( - "ต้าอ่วยวาทกรรมอาว์เซี้ยว กระดี๊กระด๊า ช็อปซาดิสต์โมจิดีพาร์ตเมนต์ อินดอร์วิว สี่แยกมาร์กจ๊อกกี้ โซนี่บัตเตอร์ฮันนีมูน ยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์ บอยคอตต์เฟอร์รี่บึมมาราธอน ", - "ต้าอ่วยวาทกรรมอาว์เซี้ยว กระดี๊กระด๊า\nช็อปซาดิสต์โมจิดีพาร์ตเมนต์ อินดอร์วิว\nสี่แยกมาร์กจ๊อกกี้ โซนี่บัตเตอร์ฮันนีมูน\nยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข\n่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์\nบอยคอตต์เฟอร์รี่บึมมาราธอน", - ), - ( - "ต้าอ่วยวาท{red}กรรมอาว์เซี้ยว กระดี๊กระด๊า {/red}ช็อปซาดิสต์โมจิดีพาร์ตเม{blue underline}นต์ อินดอร์วิว สี่แยกมาร์กจ๊อกกี้ โซนี่บัตเต{/blue underline}อร์ฮันนีมูน ยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์ บอยคอตต์เฟอร์รี่บึมมาราธอน ", - "ต้าอ่วยวาท{red}กรรมอาว์เซี้ยว กระดี๊กระด๊า\n{/red}ช็อปซาดิสต์โมจิดีพาร์ตเม{blue underline}นต์ อินดอร์วิว\nสี่แยกมาร์กจ๊อกกี้ โซนี่บัตเต{/blue underline}อร์ฮันนีมูน\nยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข\n่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์\nบอยคอตต์เฟอร์รี่บึมมาราธอน", - ), - ( - "국가유공자·상이군경 및 전몰군경의 유가족은 법률이 정하는 바에 의하여", - "국가유공자·상이군경 및 전몰군경의\n 유가족은 법률이 정하는 바에\n의하여", - ), - ( - "국{red}가유공자·상이군{bold}경 및 전{/bold}몰군경의 유{/red}가족은 법률이 정하는 바에 의하여", - "국{red}가유공자·상이군{bold}경 및 전{/bold}몰군경의\n 유{/red}가족은 법률이 정하는 바에\n의하여", - ), - ( - "朗眠裕安無際集正聞進士健音社野件草売規作独特認権価官家複入豚末告設悟自職遠氷育教載最週場仕踪持白炎組特曲強真雅立覧自価宰身訴側善論住理案者券真犯著避銀楽験館稿告", - "朗眠裕安無際集正聞進士健音社野件草\n売規作独特認権価官家複入豚末告設悟\n自職遠氷育教載最週場仕踪持白炎組特\n曲強真雅立覧自価宰身訴側善論住理案\n者券真犯著避銀楽験館稿告", - ), - ( - "┌────────────────┬────────────────┬────────────────┬────────────────┬──────────────", - "┌────────────────┬───────────────\n─┬────────────────┬──────────────\n──┬──────────────", - ), - ( - "┌────────────abcde────┬──────────── ────┬────────abcde fghi────────┬────────────────┬──────────────", - "┌────────────abcde────┬──────────\n── ────┬────────abcde fghi───────\n─┬────────────────┬──────────────", - ), - ( - "┌─────────{red}───ab{/red}cde────┬──────{green}────── ────┬────────abcde fghi{/green}────────┬────────────────┬──────────────", - "┌─────────{red}───ab{/red}cde────┬──────{green}────\n── ────┬────────abcde fghi{/green}───────\n─┬────────────────┬──────────────", - ), - ( - "┌──────────{red}────{/red}──┬{blue bold}────────────────┬──{/blue bold}──────────────┬────────────────┬──────────────end", - "┌──────────{red}────{/red}──┬{blue bold}───────────────\n─┬──{/blue bold}──────────────┬──────────────\n──┬──────────────end", - ), - ( - "."^100, - ".................................\n.................................\n.................................\n.", - ), - ( - ".{red}|||{/red}...."^10, - ".{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....\n{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....{red}|\n||{/red}.....{red}|||{/red}....", - ), - ( - ".|||...."^10, - ".|||.....|||.....|||.....|||.....\n|||.....|||.....|||.....|||.....|\n||.....|||....", - ), - (str, str_reshaped), - (logo_str, logo_str_reshaped), + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", + "Lorem {red}ipsum dolor sit {underline}amet, consectetur{/underline} adipiscing elit, {/red}{blue}sed do eiusmod tempor incididunt{/blue} ut labore et dolore magna aliqua.", + "Lorem{red}ipsumdolorsit{underline}amet, consectetur{/underline} adipiscing elit, {/red}seddoeiusmo{blue}dtemporincididunt{/blue}ut labore et dolore magna aliqua.", + "ต้าอ่วยวาทกรรมอาว์เซี้ยว กระดี๊กระด๊า ช็อปซาดิสต์โมจิดีพาร์ตเมนต์ อินดอร์วิว สี่แยกมาร์กจ๊อกกี้ โซนี่บัตเตอร์ฮันนีมูน ยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์ บอยคอตต์เฟอร์รี่บึมมาราธอน ", + "ต้าอ่วยวาท{red}กรรมอาว์เซี้ยว กระดี๊กระด๊า {/red}ช็อปซาดิสต์โมจิดีพาร์ตเม{blue underline}นต์ อินดอร์วิว สี่แยกมาร์กจ๊อกกี้ โซนี่บัตเต{/blue underline}อร์ฮันนีมูน ยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์ บอยคอตต์เฟอร์รี่บึมมาราธอน ", + "국가유공자·상이군경 및 전몰군경의 유가족은 법률이 정하는 바에 의하여", + "국{red}가유공자·상이군{bold}경 및 전{/bold}몰군경의 유{/red}가족은 법률이 정하는 바에 의하여", + "朗眠裕安無際集正聞進士健音社野件草売規作独特認権価官家複入豚末告設悟自職遠氷育教載最週場仕踪持白炎組特曲強真雅立覧自価宰身訴側善論住理案者券真犯著避銀楽験館稿告", + "┌────────────────┬────────────────┬────────────────┬────────────────┬──────────────", + "┌────────────abcde────┬──────────── ────┬────────abcde fghi────────┬────────────────┬──────────────", + "┌─────────{red}───ab{/red}cde────┬──────{green}────── ────┬────────abcde fghi{/green}────────┬────────────────┬──────────────", + "┌──────────{red}────{/red}──┬{blue bold}────────────────┬──{/blue bold}──────────────┬────────────────┬──────────────end", + "."^100, + ".{red}|||{/red}...."^10, + ".|||...."^10, ] width = 33 debug = false - for (i, (input, expected)) in enumerate(strings) - reshaped = reshape_text(input, width) - reshaped_no_ansi = remove_markup(reshaped) - lens = length.(split(reshaped_no_ansi, '\n')) - if debug && reshaped != expected - println("== reshaped == ") - println(reshaped) - println(repr(reshaped)) - println("\n== reshaped no ansi == ") - println(reshaped_no_ansi) - println("\n== expected == ") - println(expected) - end - # FIXME: should work when `length(input) != ncodeunits(input)` using non unit byte characters: see docs.julialang.org/en/v1/manual/strings/#Unicode-and-UTF-8 - if length(input) == ncodeunits(input) && !occursin('\n', input) + for (i, txt) in enumerate(strings) + reshaped = reshape_text(txt, width) + lens = length.(split(cleantext(reshaped), '\n')) + + # println(width, lens) + # println(apply_style(reshaped)) + # println("_"^width) + + if length(txt) == ncodeunits(txt) && !occursin('\n', txt) (debug && any(lens .> width)) && println(lens) @test all(lens .≤ width) end - @test reshaped == expected + IS_WIN || @compare_to_string reshaped "reshaped_text_$(i)" end for width in (40, 60, 99) - rh = reshape_text(str, width) - @test all(textlen.(split(rh, '\n')) .≤ width) + rh = reshape_text(strings[1], width) + @test all(textlen.(split(rh, '\n'); remove_orphan_tags = true) .≤ width) end - - # for i in 5:10 - # width = 2^i - # for offset in (-(width ÷ 2)):(width ÷ 2) - # txt = '.'^(2width + offset) - # rt = reshape_text(txt, width) - # len = length.(split(rt, '\n')) - # # @show length(txt) width rt len - # @test all(len[1:(end - 1)] .<= width) - # @test len[end] == (offset > 0 ? offset : width + offset) - # end - # end end @testset "Text justify" begin str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." _str = reshape_text(str, 50) - @compare_to_string(justify(str, 150), "justify") + IS_WIN || @compare_to_string(justify(str, 150), "justify") + + txt = "adsda\nadasda\nergeer\nxcvxvxvx\naasdada" + IS_WIN || @compare_to_string(fillin(txt), "fill_in_1") + IS_WIN || @compare_to_string(fillin(txt; bg = "red"), "fill_in_2") +end + +@testset "str_trunc" begin + str = "Lorem ipsum dolor sit amet,\n consectetur adipiscing elit, sed do eiusmod \ntempor incididunt ut labore et dolore\n magna aliqua." + + for (i, w) in enumerate((12, 51, 31)) + IS_WIN || @compare_to_string(str_trunc(str, w), "str_trunc_$(i)") + end +end + +@testset "code reshaping" begin + codes = [ + "{#f2d777}Table{/#f2d777}(data::Matrix{Float64}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})", + "{}}, Tuple{{}}, NamedTuple{(), Tuple{{}}}}){#f2d777}Table{/#f2d777}", + "{#f2d777}Table{/#f2d777}(tb::Tables.MatrixTable{Matrix{Float64}}; box::Symbol, style::String, hpad::Int64, vpad::Int64, vertical_justify::Symbol, show_header::Bool, header::Nothing, header_style::String, header_justify::Nothing, columns_style::String, columns_justify::Symbol, columns_widths::Nothing, footer::Nothing, footer_style::String, footer_justify::Symbol, compact::Bool)", + "{#f2d777}calc_columns_widths{/#f2d777}(N_cols::Int64, N_rows::Int64, columns_widths::Nothing, show_header::Bool, header::Tuple{String, String, String}, tb::Tables.MatrixTable{Matrix{Float64}}, sch::Tables.Schema{(:Column1, :Column2, :Column3), Tuple{Float64, Float64, Float64}}, footer::Nothing, hpad::Vector{Int64})", + """(::Term.Tables.var"#1#3"{Tables.MatrixTable{Matrix{Float64}}})(c::Symbol)""", + ] + + widths = (32, 65, 88) + + for (i, c) in enumerate(codes), (j, w) in enumerate(widths) + reshaped = reshape_code_string(c, w) + @test get_width(reshaped) <= w + IS_WIN || @compare_to_string reshaped "reshaped_code_$(i)_$(j)" + end +end + +@testset "markup reshaping" begin + txts = [ + "{red}dasda asda dadasda{green}aadasdad{/green}dad asd ad ad ad asdad{bold}adada ad as sad ad ada{/red}ad adas sd ads {/bold}", + "{red}adasd ad sa dsa{green} ad {blue} sd d ads ad {/blue}da dad {/green} asdsa dad a {/red}", + "{red}adasd ad sa dsa{bold} ad {blue} sd d ads ad {/blue}da dad {/bold} asdsa dad a {/red}", + "{red}adasd ad sa dsa{green} ad {blue} sd d ads ad da dad {/green} asdsa ddfsf {/blue}ad a {/red}", + "{on_red}adasd ad sa dsa{green} ad {on_black} sd d ads ad da{/on_black} dad {/green} asdsa ddfsf ad a {/on_red}", + "{on_(25, 25, 25)}adasd ad sa dsa{green} ad {on_black} sd d ads ad da{/on_black} {white}dad{/white} asad {/green} asdsa ddfsf ad a {/on_(25, 25, 25)}", + "{(220, 180, 150)} pink {bold}pink bold {dodger_blue2} pink bold blue {/dodger_blue2} pink bold {/bold} pink {on_(25, 55, 100)} pink on blue {/(220, 180, 150)} just on blue {/on_(25, 55, 100)} NOW SIMPLE WHITE {red} red red red {/red} white white {underline} underline underline {/underline}", + ] + widths = (32, 65, 20) + + for (i, txt) in enumerate(txts) + for (j, w) in enumerate(widths) + reshaped = reshape_text(txt, w) + IS_WIN || @compare_to_string reshaped "reshaped_text_markuo_$(j)_$(i)" + end + end end diff --git a/test/03_test_measure.jl b/test/03_test_measure.jl index b82097b82..a67524f00 100644 --- a/test/03_test_measure.jl +++ b/test/03_test_measure.jl @@ -36,6 +36,7 @@ end w = h = 5 p = Panel(width = w, height = h) @test height(p) == h + @test height(string(p)) == h @test width(p) == w s = first(p.segments) diff --git a/test/04_test_style.jl b/test/04_test_style.jl index 36b8b51c8..a0a13ae17 100644 --- a/test/04_test_style.jl +++ b/test/04_test_style.jl @@ -1,5 +1,5 @@ import Term.Style: apply_style -import Term: tprint, tprintln, get_file_format +import Term: tprint, tprintln, get_file_format, reshape_text @testset "\e[34mStyle\e[0m" begin @test apply_style("test") == "test" @@ -16,13 +16,61 @@ import Term: tprint, tprintln, get_file_format test {red} sdfsdf fdsf{/red} {bold} sfsdfp{green} sdfsdp{/green}sdsdfs pdfsdp{/bold}""") == - "test \e[31m sdfsdf\nfdsf\e[39m \e[1m sfsdfp\e[32m sdfsdp\e[39m\e[1msdsdfs\npdfsdp\e[22m\e[39m" + "test \e[31m sdfsdf\nfdsf\e[39m \e[1m sfsdfp\e[32m sdfsdp\e[39msdsdfs\npdfsdp\e[22m" # check that parentheses are escaped correctly @test apply_style("This and that {{something}} for") == "This and that {{something}} for" end +@testset "Style with nested tags" begin + txt = "{red}adasd ad sa dsa{green} ad {blue} sd d ads ad {/blue}da dad {/green} asdsa dad a {/red}" + @test apply_style(txt) == + "\e[31madasd ad sa dsa\e[32m ad \e[34m sd d ads ad \e[39m\e[32mda dad \e[39m\e[31m asdsa dad a \e[39m" + + txt = "{red}adasd ad sa dsa{bold} ad {blue} sd d ads ad {/blue}da dad {/bold} asdsa dad a {/red}" + @test apply_style(txt) == + "\e[31madasd ad sa dsa\e[1m ad \e[34m sd d ads ad \e[39m\e[31mda dad \e[22m\e[31m asdsa dad a \e[39m" + + txt = "{red}adasd ad sa dsa{green} ad {blue} sd d ads ad da dad {/green} asdsa ddfsf {/blue}ad a {/red}" + @test apply_style(txt) == + "\e[31madasd ad sa dsa\e[32m ad \e[34m sd d ads ad da dad \e[39m\e[31m asdsa ddfsf \e[39mad a \e[39m" + + txt = "{on_red}adasd ad sa dsa{green} ad {on_black} sd d ads ad da{/on_black} dad {/green} asdsa ddfsf ad a {/on_red}" + @test apply_style(txt) == + "\e[41madasd ad sa dsa\e[32m ad \e[40m sd d ads ad da\e[49m\e[32m\e[41m dad \e[39m\e[41m asdsa ddfsf ad a \e[49m" + + txt = "{on_(25, 25, 25)}adasd ad sa dsa{green} ad {on_black} sd d ads ad da{/on_black} {white}dad{/white} asad {/green} asdsa ddfsf ad a {/on_(25, 25, 25)}" + @test apply_style(txt) == + "\e[48;2;25;25;25madasd ad sa dsa\e[32m ad \e[40m sd d ads ad da\e[49m\e[32m\e[48;2;25;25;25m \e[37mdad\e[39m\e[32m asad \e[39m\e[48;2;25;25;25m asdsa ddfsf ad a \e[49m" + + txt = "{(220, 180, 150)} pink {bold}pink bold {dodger_blue2} pink bold blue {/dodger_blue2} pink bold {/bold} pink {on_(25, 55, 100)} pink on blue {/(220, 180, 150)} just on blue {/on_(25, 55, 100)} NOW SIMPLE WHITE {red} red red red {/red} white white {underline} underline underline {/underline}" + @test apply_style(txt) == + "\e[38;2;220;180;150m pink \e[1mpink bold \e[38;5;27m pink bold blue \e[39m\e[38;2;220;180;150m pink bold \e[22m\e[38;2;220;180;150m pink \e[48;2;25;55;100m pink on blue \e[39m just on blue \e[49m NOW SIMPLE WHITE \e[31m red red red \e[39m white white \e[4m underline underline \e[24m" +end + +@testset "Style with nested tags and reshaping" begin + txts = [ + "{red}adasd ad sa dsa{green} ad {blue} sd d ads ad {/blue}da dad {/green} asdsa dad a {/red}", + "{red}adasd ad sa dsa{bold} ad {blue} sd d ads ad {/blue}da dad {/bold} asdsa dad a {/red}", + "{red}adasd ad sa dsa{green} ad {blue} sd d ads ad da dad {/green} asdsa ddfsf {/blue}ad a {/red}", + "{on_red}adasd ad sa dsa{green} ad {on_black} sd d ads ad da{/on_black} dad {/green} asdsa ddfsf ad a {/on_red}", + "{on_(25, 25, 25)}adasd ad sa dsa{green} ad {on_black} sd d ads ad da{/on_black} {white}dad{/white} asad {/green} asdsa ddfsf ad a {/on_(25, 25, 25)}", + "{(220, 180, 150)} pink {bold}pink bold {dodger_blue2} pink bold blue {/dodger_blue2} pink bold {/bold} pink {on_(25, 55, 100)} pink on blue {/(220, 180, 150)} just on blue {/on_(25, 55, 100)} NOW SIMPLE WHITE {red} red red red {/red} white white {underline} underline underline {/underline}", + ] + + sizes = (25, 33, 61) + + for (i, txt) in enumerate(txts) + for (j, w) in enumerate(sizes) + IS_WIN || + @compare_to_string apply_style(reshape_text(txt, w)) "nested_tags_reshape_$(i)_$(j)" + IS_WIN || + @compare_to_string reshape_text(apply_style(txt), w) "nested_tags_reshape_$(i)_$(j)_reverse" + end + end +end + @testset "\e[34mTprint\e[0m" begin stprint(x) = chomp(sprint(tprint, x; context = stdout)) stprintln(x) = chomp(sprint(tprintln, x; context = stdout)) @@ -46,7 +94,7 @@ end test {red} sdfsdf fdsf{/red} {bold} sfsdfp{green} sdfsdp{/green}sdsdfs pdfsdp{/bold}""") == - "test \e[31m sdfsdf\nfdsf\e[39m \e[1m sfsdfp\e[32m sdfsdp\e[39m\e[1msdsdfs\npdfsdp\e[22m\e[39m" + "test \e[31m sdfsdf\nfdsf\e[39m \e[1m sfsdfp\e[32m sdfsdp\e[39msdsdfs\npdfsdp\e[22m" @test stprint("This and that {{something}} for") == "This and that {{something}} for" end diff --git a/test/06_test_box.jl b/test/06_test_box.jl index dd4502fc9..7b8d45050 100644 --- a/test/06_test_box.jl +++ b/test/06_test_box.jl @@ -48,7 +48,7 @@ import Term: Segment ) @test left.measure.w == 22 @test left.text == - "\e[31m╭──── \e[34mtest\e[39m\e[31m\e[31m ──────────╮\e[39m\e[0m\e[39m\e[31m" + "\e[0m\e[31m╭──── \e[34mtest\e[39m\e[31m\e[31m ──────────╮\e[39m\e[0m\e[39m" right = get_title_row( :top, @@ -61,7 +61,7 @@ import Term: Segment ) @test right.measure.w == 22 @test right.text == - "\e[31m╭─────────── \e[34mtest\e[39m\e[31m\e[31m ───╮\e[39m\e[0m\e[39m\e[31m" + "\e[0m\e[31m╭─────────── \e[34mtest\e[39m\e[31m\e[31m ───╮\e[39m\e[0m\e[39m" center = get_title_row( :top, @@ -74,7 +74,7 @@ import Term: Segment ) @test center.measure.w == 22 @test center.text == - "\e[31m╭─────── \e[34mtest\e[39m\e[31m\e[31m ───────╮\e[39m\e[0m\e[39m\e[31m" + "\e[0m\e[31m╭─────── \e[34mtest\e[39m\e[31m\e[31m ───────╮\e[39m\e[0m\e[39m" for width in (15, 21, 33, 58), justify in (:left, :center, :right) line = get_title_row( diff --git a/test/07_test_renderables.jl b/test/07_test_renderables.jl index 22eed36ea..dd8b994bb 100644 --- a/test/07_test_renderables.jl +++ b/test/07_test_renderables.jl @@ -1,7 +1,7 @@ import Term.Renderables: Renderable, RenderableText, AbstractRenderable, trim_renderable import Term: Panel import Term.Segments: Segment -import Term: fillin +import Term: fillin, apply_style @testset "\e[34mSegment" begin seg = Segment("test", "default") @@ -39,18 +39,20 @@ end width = 22 r = RenderableText(lorem; width = width) @test string(r) == - "Lorem ipsum dolor \nsit amet, consectetur \n adipiscing elit, \nsed do eiusmod tempor \n incididunt ut labore " + "Lorem ipsum dolor\e[0m \nsit amet, consectetur\e[0m \n adipiscing elit,\e[0m \nsed do eiusmod tempor\e[0m \n incididunt ut labore\e[0m \n\e[0m " @test r.measure.w == width r = RenderableText(lorem; width = width, style = "red") @test string(r) == - "\e[31mLorem ipsum dolor \e[39m\n\e[31msit amet, consectetur \e[39m\n\e[31m adipiscing elit, \e[39m\n\e[31msed do eiusmod tempor \e[39m\n\e[31m incididunt ut labore \e[39m" + "\e[31mLorem ipsum dolor\e[0m \e[39m\n\e[31msit amet, consectetur\e[0m \e[39m\n\e[31m adipiscing elit,\e[0m \e[39m\n\e[31msed do eiusmod tempor\e[0m \e[39m\n\e[31m incididunt ut labore\e[0m \e[39m\n\e[31m\e[0m \e[39m" @test r.measure.w == width @test string(RenderableText("a string")) == "a string" @test string(RenderableText("a\nstring")) == "a \nstring" @test_nothrow @capture_out show(r) + + @test sprint(io -> show(io, MIME("text/plain"), r)) == string(r) * "\n" end @testset "\e[34mRenderables - RenderableText basic" begin @@ -66,6 +68,15 @@ end end end +@testset "\e[34mRenderables - RenderableText shape" begin + lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + for (i, w) in enumerate([10, 12, 15, 18, 23, 25, 60]) + t = RenderableText(lorem; width = w) + @testpanel(t, nothing, w) + IS_WIN || @compare_to_string(t, "rend_text_shape_$(i)") + end +end + @testset "\e[34mRenderables - trim renderables" begin IS_WIN || begin r = trim_renderable(RenderableText("aa bb"^100), 25) @@ -75,3 +86,25 @@ end @compare_to_string(r, "trim_renderables_2") end end + +@testset "Renderables reshaped text markup" begin + txt = "{red}dasda asda dadasda{green}aadasdad{/green}dad asd ad ad ad asdad{bold}adada ad as sad ad ada{/red}ad adas sd ads {/bold}" + IS_WIN || @compare_to_string(Panel(txt; width = 30), "reshaped_rend_with_markup_1") + IS_WIN || + @compare_to_string(RenderableText(txt; width = 30), "reshaped_rend_with_markup_2") + + txt = "{(220, 180, 150)}dasda {bold}asda dadasda{dodger_blue2}aadasdad{/dodger_blue2}dad asd ad{/bold} ad ad asdad{on_(25, 55, 100)}adada ad as sad ad ada{/(220, 180, 150)}ad adas sd ads {/on_(25, 55, 100)} NOW SIMPLE {red} adasd aads a asd ads a{/red} dasiudh asjdnasdiuasda {underline} asdnaisudnadaiuda sjduiabdiabd aduas {/underline}" + IS_WIN || @compare_to_string(Panel(txt; width = 30), "reshaped_rend_with_markup_3") + IS_WIN || + @compare_to_string(RenderableText(txt; width = 30), "reshaped_rend_with_markup_4") + + txt = "{(220, 180, 150)}dasda {bold}asda dadasda{dodger_blue2}aadasdad{/dodger_blue2}dad asd ad{/bold} ad ad asdad{on_(25, 55, 100)}adada ad as sad ad ada{/(220, 180, 150)}ad adas sd ads {/on_(25, 55, 100)} NOW SIMPLE {red} adasd aads a asd ads a{/red} dasiudh asjdnasdiuasda {underline} asdnaisudnadaiuda sjduiabdiabd aduas {/underline}" + IS_WIN || @compare_to_string( + Panel(apply_style(txt); width = 30), + "reshaped_rend_with_markup_5" + ) + IS_WIN || @compare_to_string( + RenderableText(apply_style(txt); width = 30), + "reshaped_rend_with_markup_6" + ) +end diff --git a/test/08_test_panel.jl b/test/08_test_panel.jl index 269561cec..8ff8e816b 100644 --- a/test/08_test_panel.jl +++ b/test/08_test_panel.jl @@ -88,19 +88,6 @@ end TEST_CONSOLE_WIDTH ) - # @testpanel( - # Panel(Panel(Panel("°"; fit=true, _kw...); _kw...); fit = false), - # 14, - # TEST_CONSOLE_WIDTH - # ) - - # @testpanel( - # Panel(Panel("°"^250; _kw...); fit = false), - # # WIDE_TERM ? nothing : 5, - # 17, - # TEST_CONSOLE_WIDTH - # ) - @testpanel( Panel( Panel("t1"; fit = true, _kw...), @@ -111,6 +98,15 @@ end TEST_CONSOLE_WIDTH ) + @testpanel( + Panel( + [Panel("t1"; fit = true, _kw...), Panel("t2"; fit = true, _kw...)]; + fit = false, + ), + 8, + TEST_CONSOLE_WIDTH + ) + _kw = (fit = false, height = 8, width = 30) @testpanel(Panel(Panel("test"; width = 22); _kw...), 8, 30) @@ -157,12 +153,6 @@ end @testpanel(Panel(Panel(Panel("°"; _kw...); _kw...); fit = true), 7, 19,) - # @testpanel( - # Panel(Panel("°"^250; justify = justify); fit = true), - # nothing, - # console_width() - 1, - # ) - @testpanel(Panel(Panel("t1"; _kw...), Panel("t2"; _kw...); fit = true), 8, 14,) _kw = (fit = true, width = 30, height = 8) @@ -175,41 +165,20 @@ end end @testset "PANEL - centered title style" begin - @test string( - Panel( - title = "test", - width = 40, - title_justify = :left, - title_style = "italic red", - ), - ) == - "\e[22m╭──── \e[3m\e[31mtest\e[23m\e[39m\e[22m\e[22m ────────────────────────────╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰──────────────────────────────────────╯\e[22m\e[0m" - - @test string( - Panel( + for (i, just) in enumerate([:left, :center, :right]) + p = Panel( title = "test", width = 40, - title_justify = :center, + title_justify = just, title_style = "italic red", - ), - ) == - "\e[22m╭──────────────── \e[3m\e[31mtest\e[23m\e[39m\e[22m\e[22m ────────────────╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰──────────────────────────────────────╯\e[22m\e[0m" - @test string( - Panel( - title = "test", - width = 40, - title_justify = :right, - title_style = "italic red", - ), - ) == - "\e[22m╭───────────────────────────── \e[3m\e[31mtest\e[23m\e[39m\e[22m\e[22m ───╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰──────────────────────────────────────╯\e[22m\e[0m" + ) + @testpanel(p, nothing, 40) + IS_WIN || @compare_to_string(p, "centered_title_panel_$(i)") - @test string(Panel(title = "test", width = 50, title_justify = :left)) == - "\e[22m╭──── test\e[22m ──────────────────────────────────────╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰────────────────────────────────────────────────╯\e[22m\e[0m" - @test string(Panel(title = "test", width = 50, title_justify = :center)) == - "\e[22m╭───────────────────── test\e[22m ─────────────────────╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰────────────────────────────────────────────────╯\e[22m\e[0m" - @test string(Panel(title = "test", width = 50, title_justify = :right)) == - "\e[22m╭─────────────────────────────────────── test\e[22m ───╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰────────────────────────────────────────────────╯\e[22m\e[0m" + p = Panel(title = "test", width = 50, title_justify = just) + IS_WIN || @compare_to_string(p, "centered_title_panel_$(i+3)") + @testpanel(p, nothing, 50) + end p = Panel( title = "test", @@ -218,8 +187,23 @@ end subtitle_justify = :right, width = 22, ) - @test string(p) == - "\e[22m╭──── test\e[22m ──────────╮\e[22m\e[0m\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰────────── aaaaa\e[22m ───╯\e[22m\e[0m\e[22m\e[0m" + IS_WIN || @compare_to_string(p, "centered_titile_panel_7") +end + +@testset "PANEL - small panel with title" begin + for (i, w) in enumerate((5, 9, 10, 11, 12, 13, 14, 15)) + for (j, title) in enumerate(("aa", "aaaa", "aaaaaa", "adadasdoajdoaidjaldad")) + for (k, just) in enumerate([:left, :center, :right]) + p = Panel(; + width = w, + title = title, + title_justify = just, + style = "hidden", + ) + IS_WIN || @compare_to_string(p, "small_panel_title_$(i)_$(j)_$(k)") + end + end + end end @testset "PANEL - compare to string" begin @@ -261,7 +245,7 @@ id est laborum.""", oooo """ p = Panel(circle; fit = true, padding = (2, 2, 0, 0)) @test string(p) == - "\e[22m╭────────────────╮\e[22m\n\e[0m\e[22m│\e[22m\e[0m oooo \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m oooooooooo \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m oooooooooooo \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m oooooooooooo \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m oooooooooo \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m oooo \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰────────────────╯\e[22m\e[0m" + "\e[0m\e[22m╭────────────────╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m oooo \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m oooooooooo \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m oooooooooooo \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m oooooooooooo \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m oooooooooo \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m oooo \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰────────────────╯\e[22m\e[0m\e[0m" p = Panel( "test"^25; @@ -306,20 +290,6 @@ id est laborum.""", @test size(p.measure) == (22, 49) end -# @testset "\e[34mPanel + renderables" begin -# @testpanel(Panel(RenderableText("x"^5)), 3, 11) - -@testpanel(Panel(RenderableText("x"^500); fit = false), 15, TEST_CONSOLE_WIDTH) - -@testpanel(Panel(RenderableText("x"^5); fit = true), 3, 11) - -# @testpanel( -# Panel(RenderableText("x"^500); fit = true), -# nothing, -# displaysize(stdout)[2] - 1, -# ) -# end - @testset "\e[34mPANEL - titles" begin style = "red" for fit in (true, false) @@ -362,7 +332,7 @@ ads ); background = "on_red", fit = true) @test string(p) == - "\e[22m╭──────────────────────╮\e[22m\n\e[0m\e[22m│\e[22m\e[0m\e[41m \e[49m\e[0m\e[41m\e[44m asasd\e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m\e[41m \e[49m\e[0m\e[41m\e[44masdasadas\e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m\e[41m \e[49m\e[0m\e[41m\e[44masdsasdasdsadasdsa\e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m\e[41m \e[49m\e[0m\e[41m\e[44mads\e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m\e[41m \e[49m\e[0m\e[41m\e[44m \e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\e[0m\n\e[22m╰──────────────────────╯\e[22m\e[0m" + "\e[0m\e[22m╭──────────────────────╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[41m \e[49m\e[41m\e[44m asasd\e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m\e[41m \e[49m\e[41m\e[44masdasadas\e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m\e[41m \e[49m\e[41m\e[44masdsasdasdsadasdsa\e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m\e[41m \e[49m\e[41m\e[44mads\e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m\e[41m \e[49m\e[41m\e[44m \e[49m\e[41m \e[49m\e[49m\e[41m \e[49m\e[0m\e[22m│\e[22m\n\e[0m\e[22m╰──────────────────────╯\e[22m\e[0m\e[0m" end @testset "\e[34mPANEL - UnicodePlots" begin @@ -447,3 +417,12 @@ end pns = @nested_panels Panel(Panel("a"), Panel("b"; style = "green"); style = "red") IS_WIN || @compare_to_string(pns, "panels_layout_macro6") end + +@testset "PANEL - constructors" begin + p1, p2 = Panel(; width = 5), Panel(; width = 8) + p = Panel([p1, p2]) + IS_WIN || @compare_to_string(string(p), "panels_constructors_1") + + p = Panel(string.([p1, p2])) + IS_WIN || @compare_to_string(string(p), "panels_constructors_2") +end diff --git a/test/09_test_layout.jl b/test/09_test_layout.jl index 836e3bff2..f89c0f2c6 100644 --- a/test/09_test_layout.jl +++ b/test/09_test_layout.jl @@ -50,7 +50,7 @@ end p = Panel(height = 10, width = 20) @test string(vertical_pad(p, 4, 4)) == - " \n \n \n \n\e[22m╭──────────────────╮\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰──────────────────╯\e[22m\e[0m\n \n \n \n " + " \n \n \n \n\e[0m\e[22m╭──────────────────╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰──────────────────╯\e[22m\e[0m\e[0m\n \n \n \n " vertical_pad!(p, 4, 4) @test p isa Panel @@ -60,6 +60,14 @@ end vertical_pad!(p; height = 30) @test p isa Panel @test size(p.measure) == (30, 20) + + p = Panel(height = 2, width = 4) + @test string(vertical_pad(p; height = 5, method = :top)) == + "\e[0m\e[22m╭──╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰──╯\e[22m\e[0m\e[0m\n \n " + @test string(vertical_pad(p; height = 5, method = :bottom)) == + " \n \n\e[0m\e[22m╭──╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰──╯\e[22m\e[0m\e[0m" + @test string(vertical_pad(p; height = 5, method = :center)) == + " \n\e[0m\e[22m╭──╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰──╯\e[22m\e[0m\e[0m\n " end @testset "\e[34mlayout - spacer" begin @@ -67,6 +75,9 @@ end for (w, h) in sizes spacer = Spacer(h, w) @test size(spacer.measure) == (h, w) + + spacer = Spacer(h + 0.1, w + 0.1) + @test size(spacer.measure) == (h, w) end end @@ -99,7 +110,7 @@ end @test pp isa Renderable @test pp.measure.w == 15 @test string(pp) == - "\e[22m╭───╮\e[22m \n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m \n\e[22m╰───╯\e[22m\e[0m \n\e[22m╭────────╮\e[22m \n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m \n\e[22m╰────────╯\e[22m\e[0m \n\e[22m╭─────────────╮\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰─────────────╯\e[22m\e[0m" + "\e[0m\e[22m╭───╮\e[22m\e[0m \n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m \n\e[0m\e[22m╰───╯\e[22m\e[0m\e[0m \n\e[0m\e[22m╭────────╮\e[22m\e[0m \n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m \n\e[0m\e[22m╰────────╯\e[22m\e[0m\e[0m \n\e[0m\e[22m╭─────────────╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰─────────────╯\e[22m\e[0m\e[0m" @test p1 isa Panel @test p1.measure.w == 5 @@ -108,7 +119,7 @@ end @test pp isa Renderable @test pp.measure.w == 15 @test string(pp) == - " \e[22m╭───╮\e[22m \n \e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m \n \e[22m╰───╯\e[22m\e[0m \n \e[22m╭────────╮\e[22m \n \e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m \n \e[22m╰────────╯\e[22m\e[0m \n\e[22m╭─────────────╮\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰─────────────╯\e[22m\e[0m" + " \e[0m\e[22m╭───╮\e[22m\e[0m \n \e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m \n \e[0m\e[22m╰───╯\e[22m\e[0m\e[0m \n \e[0m\e[22m╭────────╮\e[22m\e[0m \n \e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m \n \e[0m\e[22m╰────────╯\e[22m\e[0m\e[0m \n\e[0m\e[22m╭─────────────╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰─────────────╯\e[22m\e[0m\e[0m" @test p1 isa Panel @test p1.measure.w == 5 @@ -117,7 +128,7 @@ end @test pp isa Renderable @test pp.measure.w == 15 @test string(pp) == - " \e[22m╭───╮\e[22m\n \e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n \e[22m╰───╯\e[22m\e[0m\n \e[22m╭────────╮\e[22m\n \e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n \e[22m╰────────╯\e[22m\e[0m\n\e[22m╭─────────────╮\e[22m\n\e[0m\e[22m│\e[22m\e[0m \e[0m\e[22m│\e[22m\e[0m\n\e[22m╰─────────────╯\e[22m\e[0m" + " \e[0m\e[22m╭───╮\e[22m\e[0m\n \e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n \e[0m\e[22m╰───╯\e[22m\e[0m\e[0m\n \e[0m\e[22m╭────────╮\e[22m\e[0m\n \e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n \e[0m\e[22m╰────────╯\e[22m\e[0m\e[0m\n\e[0m\e[22m╭─────────────╮\e[22m\e[0m\n\e[0m\e[22m│\e[22m \e[0m\e[22m│\e[22m\n\e[0m\e[22m╰─────────────╯\e[22m\e[0m\e[0m" @test p1 isa Panel @test p1.measure.w == 5 end diff --git a/test/11_test_theme.jl b/test/11_test_theme.jl index 6ebee2ec0..520680fed 100644 --- a/test/11_test_theme.jl +++ b/test/11_test_theme.jl @@ -31,11 +31,14 @@ end warn = "green", error = "bold #d13f3f", logmsg = "#8abeff", - tree_title = "green italic", - tree_node = "yellow italic", - tree_leaf = "yellow", - tree_guide = "red", - tree_max_width = 22, + tree_mid = "blue", + tree_terminator = "blue", + tree_skip = "blue", + tree_dash = "blue", + tree_trunc = "blue", + tree_pair = "red", + tree_keys = "green", + tree_max_leaf_width = 22, repr_accent = "green", repr_name = "yellow", repr_type = "red", diff --git a/test/13_test_logs.jl b/test/13_test_logs.jl index f126c14b1..85ee09a75 100644 --- a/test/13_test_logs.jl +++ b/test/13_test_logs.jl @@ -5,9 +5,8 @@ using Term.Progress import ProgressLogging import UUIDs: uuid4 -install_term_logger() - @testset "\e[34mLOGS test" begin + install_term_logger() println("\nTesting logging, stdout temporarily disabled") @suppress_out begin @@ -29,6 +28,7 @@ install_term_logger() sdfs s""" 1 + 2 end + uninstall_term_logger() end @testset "\e[34mLOGS handle_progress" begin diff --git a/test/14_test_highlight.jl b/test/14_test_highlight.jl index 86de2043c..e0de4b35c 100644 --- a/test/14_test_highlight.jl +++ b/test/14_test_highlight.jl @@ -1,4 +1,6 @@ -import Term: load_code_and_highlight, highlight_syntax, highlight +import Term: + load_code_and_highlight, highlight_syntax, highlight, reshape_code_string, str_trunc +import Term.Style: apply_style @testset "\e[34mHIGHLIGHT" begin @test highlight("test 1 123 33.4 44,5 +1 -2 12 0.5, ,, ...") == @@ -22,12 +24,14 @@ import Term: load_code_and_highlight, highlight_syntax, highlight @test highlight(print;) == "\e[38;2;242;215;119mprint\e[39m" @test highlight("this :this :(x+y) 'a'";) == - "this {#FFA726}:this{/#FFA726} {#FFCA28}:{#FFF59D}({/#FFF59D}x{#EF5350}+{/#EF5350}y{#FFF59D}){/#FFF59D}{/#FFCA28} {#64b565}'a'{/#64b565}" + "this {#FFA726}:this{/#FFA726} {#FFCA28}:(x{#EF5350}+{/#EF5350}y){/#FFCA28} {#64b565}'a'{/#64b565}" @test highlight(:x;) == "\e[38;2;255;167;38mx\e[39m" @test highlight(:(x + y);) == "\e[38;2;255;202;40mx + y\e[39m" +end +@testset "HIGHLIGHT syntax basic" begin @test highlight_syntax(""" This is ::Int64 my style print(x + 2) @@ -46,3 +50,20 @@ import Term: load_code_and_highlight, highlight_syntax, highlight @test load_code_and_highlight("02_test_ansi.jl", 92)[1:100] == " {grey39}89{/grey39} \e[38;2;222;222;222m \e[39m\e[38;2;222;222;222mhexes\e[39m\e[38;2;222;222;222m \e" end + +@testset "HIGHLIGHT syntax adv" begin + for (i, ln) in enumerate((1, 2, 5, 90, 93, 94)) + for (j, δ) in enumerate((0, 1, 3, 5)) + _code = load_code_and_highlight("02_test_ansi.jl", ln; δ = δ) + IS_WIN || @compare_to_string(_code, "code_highlight_$(i)_$(j)") + + for (k, w) in enumerate((15, 33, 67)) + _code_w = reshape_code_string(_code, w) + IS_WIN || @compare_to_string(_code_w, "code_highlight_$(i)_$(j)_$(k)") + + _code_s = str_trunc(apply_style(_code), w; ignore_markup = true) + IS_WIN || @compare_to_string(_code_s, "code_highlight_$(i)_$(j)_$(k)_trunc") + end + end + end +end diff --git a/test/16_test_tree.jl b/test/16_test_tree.jl index 569b88a9c..a8a53976f 100644 --- a/test/16_test_tree.jl +++ b/test/16_test_tree.jl @@ -1,98 +1,84 @@ -import Term: Tree +import Term: Tree, TERM_THEME, LightTheme import OrderedCollections: OrderedDict -tree_dict = Dict( - "nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfdsfsdfd" => - Dict("n1" => 1, "n2" => 2), -) - -tree_dict_1 = - Dict("nested" => Dict("n1" => 1, "n2" => 2), "nested2" => Dict("n1" => "a", "n2" => 2)) - -tree_dict_2 = Dict( - "nested" => Dict("n1" => 1, "n2" => 2), - "leaf2" => 2, - "leaf" => 2, - "leafme" => "v", - "canopy" => "test", -) - -tree_dict_3 = Dict( - "nested" => Dict( - "deeper" => Dict("aleaf" => "unbeliefable", "leaflet" => "level 3"), - "n2" => Int, - "n3" => 1 + 2, +trees = [ + Dict( + "nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfdsfsdfd" => + Dict("n1" => 1, "n2" => 2), ), - "nested2" => Dict("n1" => "a", "n2" => 2), -) - -tree_dict_4 = Dict( - "nested" => Dict( - "deeper" => Dict( - "aleaf" => "unbeliefable", - "leaflet" => "level 3", - "sodeep" => Dict("a" => 4), + Dict("nested" => Dict("n1" => 1, "n2" => 2), "nested2" => Dict("n1" => "a", "n2" => 2)), + Dict( + "nested" => Dict("n1" => 1, "n2" => 2), + "leaf2" => 2, + "leaf" => 2, + "leafme" => "v", + "canopy" => "test", + ["a"] => :test, + ), + Dict( + "nested" => Dict( + "deeper" => Dict("aleaf" => "unbeliefable", "leaflet" => "level 3"^20), + "n2" => Int, + "n3" => 1 + 2, ), - "n2" => Int, - "n3" => 1 + 2, - "adict" => Dict("x" => 2), + "nested2" => Dict("n1" => "a", "n2" => 2), ), - "nested2" => Dict("n1" => "a", "n2" => 2), -) - -tree_dict_order_1 = - OrderedDict(3 => OrderedDict(3 => 8, 1 => "a"), 2 => OrderedDict(3 => 8, 1 => "a")) - -tree_dict_order_2 = OrderedDict(2 => 1, 3 => OrderedDict(4 => 2, "a" => 2, "b" => 1)) + Dict( + "nested" => Dict( + "deeper" => Dict( + "aleaf" => "unbeliefable", + "leaflet" => "level 3", + "sodeep" => Dict("a" => 4), + ), + "n2" => Int, + "n3" => 1 + 2, + "adict" => Dict("x" => 2), + ), + "nested2" => Dict("n1" => "a", "n2" => 2), + ), + OrderedDict(3 => OrderedDict(3 => 8, 1 => "a"), 2 => OrderedDict(3 => 8, 1 => "a")), + OrderedDict(2 => 1, 3 => OrderedDict(4 => 2, "a" => 2, "b" => 1)), + [1, 2, [2, 3, 4]], + [ + 1, + [2, [3, 4], "a"^200], + :c, + OrderedDict(2 => "a", 1 => :ok, "a" => 2, :test => [1, 2]), + ], + Int, + String, + :(print, :(x, y)), +] @testset "\e[34mTree" begin - # creation - @testtree(Tree(tree_dict), 6, 50) - - @testtree(Tree(tree_dict_1), 9, 15) - - @testtree(Tree(tree_dict_2), 10, 18) - - @testtree(Tree(tree_dict_3), 12, 33) - - @testtree(Tree(tree_dict_4), 16, 33) - - @testtree(Tree(tree_dict_order_1), 9, 14) - @testtree(Tree(tree_dict_order_2), 8, 14) - - # styling - for guides_type in (:standardtree, :boldtree, :asciitree) - @test_nothrow Tree( - tree_dict; - title = string(guides_type), - guides_type = guides_type, - ) + thm1 = TERM_THEME[] + thm2 = LightTheme + + for (i, theme) in enumerate((thm1, thm2)) + for (j, guides_type) in enumerate((:standardtree, :boldtree, :asciitree)) + for (k, tree) in enumerate(trees) + if VERSION ≥ v"1.7" # ! not sure why but this fails in older versions: segmentation fault + IS_WIN || @compare_to_string string( + Tree( + tree; + theme = theme, + guides = guides_type, + printkeys = true, + title = "tree_$(i)_$(j)_$(k)", + ), + ) "tree_$(i)_$(j)_$(k)" + end + end + end end - @testtree( - Tree( - tree_dict; - title = "my colors", - title_style = "bold red", - node_style = "blue underline", - leaf_style = "green", - guides_style = "red dim", - ), - 6, - 52, - ) - # test with no errors @test_nothrow Tree(Float64) @test_nothrow Tree(AbstractFloat) - # compare to string - IS_WIN || begin - @compare_to_string(Tree(tree_dict), "tree_1") - @compare_to_string(Tree(tree_dict_1), "tree_2") - @compare_to_string(Tree(tree_dict_2), "tree_3") - @compare_to_string(Tree(tree_dict_3), "tree_4") - @compare_to_string Tree(tree_dict_order_1) "tree_5" - @compare_to_string Tree(tree_dict_order_2) "tree_6" - end + # test printing + @test sprint(io -> show(io, Tree(trees[1]))) == + "\e[38;5;117mTree <: AbstractRenderable\e[0m \e[2m(h:10, w:80)\e[0m" + @test sprint(io -> show(io, MIME("text/plain"), Tree(trees[1]).segments[1])) == + "Segment{String} \e[2m(size: Measure (h: 1, w: 80))\e[0m" end diff --git a/test/18_test_table.jl b/test/18_test_table.jl index 9b2bab674..e9d33d895 100644 --- a/test/18_test_table.jl +++ b/test/18_test_table.jl @@ -22,9 +22,11 @@ t3 = Table( ) t4 = Table(data; footer = ["get", "a", "footer"], footer_justify = :center) -t5 = Table(data; footer = sum, footer_justify = :center, footer_style = "dim bold") +if VERSION >= v"1.7.1" + t5 = Table(data; footer = sum, footer_justify = :center, footer_style = "dim bold") -t7 = Table(data; columns_widths = [25, 7, 7], footer = sum, box = :SIMPLE) + t7 = Table(data; columns_widths = [25, 7, 7], footer = sum, box = :SIMPLE) +end ph1 = PlaceHolder(25, 5) ph2 = PlaceHolder(23, 9) @@ -47,12 +49,21 @@ t8 = Table( ) # save tables as strings to files -tbls = [t1, t2, t3, t4, t5, t6, t7, t8] +if VERSION >= v"1.7.1" + tbls = [t1, t2, t3, t4, t5, t6, t7, t8] +else + tbls = [t1, t2, t3, t4, nothing, t6, nothing, t8] +end @testset "TABLE" begin for (i, t) in enumerate(tbls) + isnothing(t) && continue name = string("table_$i") IS_WIN || @compare_to_string(cleanstring(t), name) end + + # test table with problems + VERSION >= v"1.7.1" && + Table(data; columns_widths = [25, 7, 7, 12, 41, 52], footer = sum, box = :SIMPLE) end diff --git a/test/19_test_repr.jl b/test/19_test_repr.jl index 9e2e2969a..1a46ddb94 100644 --- a/test/19_test_repr.jl +++ b/test/19_test_repr.jl @@ -1,6 +1,6 @@ install_term_repr() import Term.Consoles: clear -import Term: default_width +import Term: Panel sprint_termshow(io::IO, x) = termshow(io, x; width = 60) @@ -22,29 +22,16 @@ end end obj = Rocket(10, 50, 5000, "NASA") + @with_repr struct T end - io = IOBuffer() - show(IOContext(io), "text/plain", obj) - s = String(take!(io)) - - IS_WIN || begin - @compare_to_string(s, "termshow_panel") - - correct_s = load_from_txt("termshow_panel") - @test s == correct_s - @test sprint(termshow, obj) == correct_s + VERSION ≥ v"1.7" && begin + IS_WIN || @compare_to_string sprint(termshow, obj) "repr_rocket" + IS_WIN || @compare_to_string sprint(termshow, Rocket) "repr_rocket_struct" + IS_WIN || @compare_to_string sprint(termshow, T()) "repr_T_struct" end - - termshow(devnull, Rocket) # coverage - - @with_repr struct T end - @test sprint(termshow, T()) == - "\e[38;2;155;179;224m╭──────────╮\e[39m\n\e[0m\e[38;2;155;179;224m│\e[39m\e[0m T()\e[38;2;187;134;219m::T\e[39m \e[0m\e[38;2;155;179;224m│\e[39m\e[0m\n\e[38;2;155;179;224m╰──── \e[38;2;227;172;141mT\e[39m\e[38;2;155;179;224m\e[38;2;155;179;224m ───╯\e[39m\e[0m\e[39m\e[38;2;155;179;224m\e[0m\n" end @testset "REPR @with_repr with doc" begin - # just check that creating a @with_repr is ok - """docs""" @with_repr struct Rocket2 width::Int @@ -53,6 +40,12 @@ end manufacturer::String end + + r = Rocket2(1, 1, 1.0, "me") + _repr = sprint(io -> show(io, MIME("text/plain"), r)) + IS_WIN || @compare_to_string _repr "repr_rocket_2" + IS_WIN || + @compare_to_string sprint(io -> show(io, MIME("text/plain"), Rocket2)) "repr_rocket_2_show" end objs = if VERSION >= v"1.7.1" @@ -67,6 +60,7 @@ objs = if VERSION >= v"1.7.1" (8, :(x / y + √9)), (9, zeros(10)), (10, zeros(5, 5)), + (11, zeros(100, 100, 100)), ) else ( diff --git a/test/23_test_link.jl b/test/23_test_link.jl new file mode 100644 index 000000000..2d1b29fc0 --- /dev/null +++ b/test/23_test_link.jl @@ -0,0 +1,72 @@ +using Term.Links +import Term.Links: LinkString +import Term.Layout: pad +import Term: RenderableText, Panel + +clean_link(l) = sprint(print, l) + +file = "/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl" +lineno = 234 + +l1 = Link(file) +l2 = Link(file, lineno) +l3 = Link(file, lineno; style = "red") + +ren = RenderableText("abcd") +lr = RenderableText(l2 * ren) + +@testset "LINK measure" begin + @test l1.measure.w == 25 + @test l2.measure.w == 29 + @test l3.measure.w == 29 + + ren_w = ren.measure.w + @test (l1 * ren).measure.w == 25 + ren_w + @test (l2 * ren).measure.w == 29 + ren_w + @test (l3 * ren).measure.w == 29 + ren_w + + @test lr.measure.w == 33 + @test (lr * ren).measure.w == 37 + + @test (l1 / l2).measure.w == 29 + @test (l1 / lr).measure.w == 33 +end + +@testset "LINK padding" begin + for (ln, link) in enumerate((l1, l2, l3)) + for (j, met) in enumerate([:left, :center, :right]) + ll = pad(link; width = 80, method = :left) + @test ll.measure.w == 80 + IS_WIN || @compare_to_string(clean_link(ll), "link_pad_$(ln)_$j") + end + end +end + +IS_WIN || @testset "LINK and panel" begin + for (ln, link) in enumerate((l1, l2, l3)) + for (i, fit) in enumerate([true, false]) + p0 = Panel(link; fit = fit) + p1 = Panel(link / ren; fit = fit) + p2 = Panel(link * ren; fit = fit) + p3 = Panel(link; width = 50) + p4 = Panel(link, p3; fit = fit) + + for (j, p) in enumerate([p0, p1, p2, p3, p4]) + @compare_to_string(clean_link(p), "link_panel_$(ln)_$(i)_$(j)") + end + end + end +end + +@testset "LINK coverage" begin + s = "abcd" + l = l1.link + + @test s * l isa LinkString + @test s / l isa LinkString + @test l / s isa LinkString + + @test textwidth(l) == l.width + @test string(l) == l + @test sprint(io -> show(io, MIME("text/plain"), l)) == sprint(io -> print(io, l)) +end diff --git a/test/24_prompts.jl b/test/24_prompts.jl new file mode 100644 index 000000000..62eea9e07 --- /dev/null +++ b/test/24_prompts.jl @@ -0,0 +1,51 @@ +using Term.Prompts +import Term.Prompts: validate_answer, AnswerValidationError + +@testset "Prompt, Creation" begin + basic = Prompt("basic prompt?") + basic_with_color = Prompt("basic prompt?", "red") + + type_prompt = TypePrompt(Int, "Gimme a number") + type_prompt_style = TypePrompt(Int, "Gimme a number", "bold red") + + opts = OptionsPrompt(["one", "two"], "What option?") + opts_style = OptionsPrompt(["one", "two"], "What option?", "red", "green") + + default = DefaultPrompt(["yes", "no"], 1, "asking", "red", "green", "blue") + default = DefaultPrompt(["yes", "no"], 1, "asking") +end + +basic = Prompt("basic prompt?") +basic_with_color = Prompt("basic prompt?", "red") + +type_prompt = TypePrompt(Int, "Gimme a number") +type_prompt_style = TypePrompt(Int, "Gimme a number", "bold red") + +opts = OptionsPrompt(["one", "two"], "What option?") +opts_style = OptionsPrompt(["one", "two"], "What option?", "red", "green") + +default = DefaultPrompt(["yes", "no"], 1, "asking", "red", "green", "blue") + +all_prompts = + (basic, basic_with_color, type_prompt, type_prompt_style, opts, opts_style, default) + +IS_WIN || @testset "Prompt, printing" begin + for (i, p) in enumerate(all_prompts) + @compare_to_string(sprint(print, p), "prompt_print_$i") + @compare_to_string(sprint(println, p), "prompt_print_$(i)_ln") + @compare_to_string(sprint(tprintln, p), "prompt_print_$(i)_t") + @compare_to_string(sprint(tprintln, p), "prompt_print_$(i)_tln") + end +end + +@testset "Prompt, validation" begin + @test validate_answer("test", basic) == "test" + + @test_throws AnswerValidationError validate_answer("sdadas", type_prompt) + @test validate_answer("1", type_prompt) == 1 + + @test isnothing(validate_answer("asdada", opts)) + @test validate_answer("one", opts) == "one" + + @test validate_answer("", default) == "yes" +end diff --git a/test/25_annotations.jl b/test/25_annotations.jl new file mode 100644 index 000000000..422f2b9aa --- /dev/null +++ b/test/25_annotations.jl @@ -0,0 +1,100 @@ +using Term.Annotations +import Term: highlight_syntax, TERM_THEME, Panel + +@testset "Annotations" begin + ann = Annotation( + highlight_syntax("Panel(content; fit=true)"), + "Panel" => ("this is the struct constructor call", TERM_THEME[].func), + "content" => ("here you put what goes inside the panel", "white"), + "fit=true" => ( + "Setting this as `true` adjusts the panel's width to fit `content`. Otherwise `Panel` will have a fixed width", + "blue_light", + ), + ) + IS_WIN || @compare_to_string(ann, "annotations_1") + + ann = Annotation( + "This is an example of an annotation to display nicely some info", + "example" => "very simple but important, pay attention!", + "annotation" => ("is it \nhelpful?", "blue"), + "some info" => ("hopefully useful", "italic green"), + ) + IS_WIN || @compare_to_string(ann, "annotations_2") + + ann = Annotation( + "{red}This is an example of an annotation to {bold}display{/bold} nicely some info{/red}", + "example" => "very simple but important, pay attention!", + "annotation" => ("is it \nhelpful?", "blue"), + "some info" => ("hopefully useful", "italic green"), + ) + IS_WIN || @compare_to_string(ann, "annotations_3") + + ann = Annotation( + "{white}This is an example of an annotation to {bold}display{/bold} nicely some info{/white}", + "some info" => ("hopefully useful", "italic green"), + "example" => "very simple but important, pay attention!", + "annotation" => ( + "is it helpful? This is a very long message to check that everything is working {red}correctly{/red}", + "default", + ), + ) + IS_WIN || @compare_to_string(ann, "annotations_4") + + ann = Annotation( + "{bold italic}this{/bold italic} has some style", + "style" => ( + "style means {bright_blue}color{/bright_blue} or stuff like {bold}bold{/bold}", + "bold red", + ), + ) + IS_WIN || @compare_to_string(ann, "annotations_5") + + code = highlight_syntax("Annotation(\"main text\", \"main\"=>\"most important\")") + ann = Panel( + Annotation( + code, + "\"main text\"" => "main message to be annotated", + "\"main\"=>\"most important\"" => "annotation", + ); + padding = (4, 4, 2, 1), + title = "Annotation: usage", + fit = true, + title_style = "default green bold", + title_justify = :center, + style = "green dim", + ) + IS_WIN || @compare_to_string(ann, "annotations_6") + + TERM_THEME[].annotation_color = "white" + txt = """Annotation("main text", "this"=>"annotation: extra info", "main text"=>("with style", "green"))""" + @test_throws AssertionError Annotation( + highlight_syntax(txt), + "Annotation" => "contructor", + "main text" => "text to be annotated", + "\"this\"=>\"annotation: extra info\"" => "simple annotation, no style", + """"main text"=>("with style", "green"))""" => "annotation with extra style info", + ) + # IS_WIN || @compare_to_string(ann, "annotations_7") + + # ann = Annotation( + # highlight_syntax(txt), + # "Annotation" => "contructor", + # "main text" => "text to be annotated.\nSubstrings of this will be annotated with extra info.", + # "\"this\"=>\"annotation: extra info\"" => "simple annotation, no style", + # """"main text"=>("with style", "green"))""" => "annotation with extra style info", + # ) + # IS_WIN || @compare_to_string(ann, "annotations_8") + + # ex = "\"to annotate\"=>(\"annotation message\", \"red\")" + # ann = Annotation( + # highlight_syntax(txt), + # "Annotation" => ("contructor", TERM_THEME[].func), + # "main text" => "text to be annotated.\nSubstrings of this will be annotated with extra info.", + # "\"this\"=>\"annotation: extra info\"" => "simple annotation, no style. Just passed as a `Pair`", + # """"main text"=>("with style", "green"))""" => ( + # "annotation with extra style info: use a `Tuple` to specify both the annotation's message and additional style info. For example:\n\n $(highlight_syntax(ex))", + # "bright_green", + # ), + # ) + # IS_WIN || @compare_to_string(ann, "annotations_9") +end diff --git a/test/99_test_errors.jl b/test/99_test_errors.jl index 212036633..47750a6c8 100644 --- a/test/99_test_errors.jl +++ b/test/99_test_errors.jl @@ -1,6 +1,8 @@ -import Term: install_term_stacktrace +import Term: install_term_stacktrace, TERM_SHOW_LINK_IN_STACKTRACE +import Term.Errors: StacktraceContext, render_backtrace -install_term_stacktrace() +install_term_stacktrace(; hide_frames = false) +TERM_SHOW_LINK_IN_STACKTRACE[] = false """ The logic behind these tests is that if something goes @@ -45,3 +47,37 @@ will be different from the one you'd expect # i + "a" # end end + +@testset "MethodError" begin + # kwargs call + struct Test3 + x::Float64 + y::Int + + # Test3(x, y, z) = new(x, y) + Test3(x, y) = new(x, y) + end + @test_throws MethodError Test3(1; a = :test) + + # convert + f(x)::Vector = 2x + @test_throws MethodError f(1) +end + +# ! this fails to pass tests for some reason. +# @testset "ERRORS - backtrace" begin +# f2(x) = 2x +# f1(x) = 3x +# f0(x; kwargs...) = begin +# st = stacktrace() +# ctx = StacktraceContext(TEST_CONSOLE_WIDTH[]) +# bt = render_backtrace(ctx, st; kwargs...) +# return string(bt) +# end + +# bt1 = f0(f2(f1(2)); hide_frames = true) +# bt2 = f0(f2(f1(2)); hide_frames = false) + +# IS_WIN || @compare_to_string(string(bt1), "backtrace_1") +# IS_WIN || @compare_to_string(string(bt2), "backtrace_2") +# end diff --git a/test/Project.toml b/test/Project.toml index 03afdb38f..c75122ec5 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] +AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" diff --git a/test/__test_utils.jl b/test/__test_utils.jl index 2c579c4c4..e7a6d05f6 100644 --- a/test/__test_utils.jl +++ b/test/__test_utils.jl @@ -109,8 +109,9 @@ macro compare_to_string(obj, filename, fn = x -> x, skip = nothing) filepath = "./txtfiles/$($filename).txt" - if TEST_DEBUG_MODE - tprint(txt, highlight = false) + if TEST_DEBUG_MODE || !isfile(filepath) # if it doesn't exist, create it. + print("\n"^3) + tprintln(txt, highlight = false) tofile(txt, filepath) else correct = load_from_txt($filename) diff --git a/test/runtests.jl b/test/runtests.jl index 6ea9073bc..40f79d45f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -33,6 +33,10 @@ macro runner(fn) end |> esc end +# @testset "Ambiguous methods" begin +# @test Test.detect_ambiguities(Term; recursive=true) +# end + @runner "01_test_text_utils.jl" @runner "02_test_ansi.jl" @runner "03_test_measure.jl" @@ -55,6 +59,9 @@ end @runner "20_test_compositor.jl" @runner "21_test_markdown.jl" @runner "22_test_grid.jl" +@runner "23_test_link.jl" +@runner "24_prompts.jl" +@runner "25_annotations.jl" @runner "98_test_examples.jl" @runner "99_test_errors.jl" diff --git a/test/txtfiles/annotations_1.txt b/test/txtfiles/annotations_1.txt new file mode 100644 index 000000000..9968476c9 --- /dev/null +++ b/test/txtfiles/annotations_1.txt @@ -0,0 +1,17 @@ +Panel(content; fit=true) +──┬── ───┬─── ────┬─── + │ │ │ + │ ╭───────────────────────────────────────╮ + ╰─│ this is the struct constructor call │ + ╰───────────────────────────────────────╯ + │ │ + │ ╭───────────────────────────────────────────╮ + ╰─│ here you put what goes inside the panel │ + ╰───────────────────────────────────────────╯ + │ + │ ╭───────────────────────────────────────╮ + ╰─│ Setting this as `true` adjusts │ + │ the panel's width to fit `content` │ + │ . Otherwise `Panel` will have │ + │ a fixed width │ + ╰───────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/annotations_2.txt b/test/txtfiles/annotations_2.txt new file mode 100644 index 000000000..f6de8d9f3 --- /dev/null +++ b/test/txtfiles/annotations_2.txt @@ -0,0 +1,32 @@ +This is an example of an annotation to display nicely some info + ───┬─── ─────┬──── ────┬──── + │ │ │ + │ ╭───────────────────────────────────────────╮ + ╰─│ very simple but important, pay attenti  │ + │ on!  │ + ╰───────────────────────────────────────────╯ + │ │ + │ ╭────────────╮ │ + ╰─│ is it  │ │ + │ helpful? │ │ + ╰────────────╯ │ + │ + │ ╭─────╮ + ╰─│ h │ + │ o │ + │ p │ + │ e │ + │ f │ + │ u │ + │ l │ + │ l │ + │ y │ + │  │ + │ u │ + │ s │ + │ e │ + │ f │ + │ u │ + │ l │ + │  │ + ╰─────╯ \ No newline at end of file diff --git a/test/txtfiles/annotations_3.txt b/test/txtfiles/annotations_3.txt new file mode 100644 index 000000000..d3d1bad44 --- /dev/null +++ b/test/txtfiles/annotations_3.txt @@ -0,0 +1,32 @@ +This is an example of an annotation to display nicely some info + ───┬─── ─────┬──── ────┬──── + │ │ │ + │ ╭───────────────────────────────────────────╮ + ╰─│ very simple but important, pay attenti  │ + │ on!  │ + ╰───────────────────────────────────────────╯ + │ │ + │ ╭────────────╮ │ + ╰─│ is it  │ │ + │ helpful? │ │ + ╰────────────╯ │ + │ + │ ╭─────╮ + ╰─│ h │ + │ o │ + │ p │ + │ e │ + │ f │ + │ u │ + │ l │ + │ l │ + │ y │ + │  │ + │ u │ + │ s │ + │ e │ + │ f │ + │ u │ + │ l │ + │  │ + ╰─────╯ \ No newline at end of file diff --git a/test/txtfiles/annotations_4.txt b/test/txtfiles/annotations_4.txt new file mode 100644 index 000000000..234fdea73 --- /dev/null +++ b/test/txtfiles/annotations_4.txt @@ -0,0 +1,34 @@ +This is an example of an annotation to display nicely some info + ───┬─── ─────┬──── ────┬──── + │ │ │ + │ ╭───────────────────────────────────────────╮ + ╰─│ very simple but important, pay attenti  │ + │ on!  │ + ╰───────────────────────────────────────────╯ + │ │ + │ ╭─────────────────────────────╮ + ╰─│ is it helpful? This  │ + │ is a very long message  │ + │ to check that everything  │ + │  is working correctly  │ + ╰─────────────────────────────╯ + │ + │ ╭─────╮ + ╰─│ h │ + │ o │ + │ p │ + │ e │ + │ f │ + │ u │ + │ l │ + │ l │ + │ y │ + │  │ + │ u │ + │ s │ + │ e │ + │ f │ + │ u │ + │ l │ + │  │ + ╰─────╯ \ No newline at end of file diff --git a/test/txtfiles/annotations_5.txt b/test/txtfiles/annotations_5.txt new file mode 100644 index 000000000..c36eb949c --- /dev/null +++ b/test/txtfiles/annotations_5.txt @@ -0,0 +1,6 @@ +this has some style + ──┬── + │ + │ ╭────────────────────────────────────────╮ + ╰─│ style means color or stuff like bold │ + ╰────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/annotations_6.txt b/test/txtfiles/annotations_6.txt new file mode 100644 index 000000000..ba2394f77 --- /dev/null +++ b/test/txtfiles/annotations_6.txt @@ -0,0 +1,15 @@ +╭────────────────────── Annotation: usage ─────────────────────╮ +│ │ +│ │ +│ Annotation("main text", "main"=>"most important") │ +│ ─────┬───── ────────────┬─────────── │ +│ │ │ │ +│ │ ╭────────────────────────────────╮ │ +│ ╰─│ main message to be annotated │ │ +│ ╰────────────────────────────────╯ │ +│ │ │ +│ │ ╭──────────────╮ │ +│ ╰─│ annotation │ │ +│ ╰──────────────╯ │ +│ │ +╰──────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/automatic_repr_1.txt b/test/txtfiles/automatic_repr_1.txt index 0d20c29af..fb83b76f1 100644 --- a/test/txtfiles/automatic_repr_1.txt +++ b/test/txtfiles/automatic_repr_1.txt @@ -1,5 +1,5 @@ -╭──── Dict {Int64, Symbol}  ──────╮ -│ │ -│  {Int64} │ 1 => x │ {Symbol}  │ -│ │ -╰────────────────────── 1 item ───╯ +╭──── Dict {Int64, Symbol}  ──────╮ +│ │ +│  {Int64} │ 1 => x │ {Symbol}  │ +│ │ +╰────────────────────── 1 item ───╯ diff --git a/test/txtfiles/automatic_repr_2.txt b/test/txtfiles/automatic_repr_2.txt index fbaccf21b..1a22848f9 100644 --- a/test/txtfiles/automatic_repr_2.txt +++ b/test/txtfiles/automatic_repr_2.txt @@ -1,6 +1,6 @@ -╭─────────────────────────────────╮ -│ x + y │ -│ ───────────────────────────── │ -│ head::Symbol│ call │ -│ args::Vector│ Any[:+, :x, :y] │ -╰──────────────────────── Expr ───╯ +╭─────────────────────────────────╮ +│ x + y │ +│ ───────────────────────────── │ +│ head::Symbol│ call │ +│ args::Vector│ Any[:+, :x, :y] │ +╰──────────────────────── Expr ───╯ diff --git a/test/txtfiles/automatic_repr_showme_1.txt b/test/txtfiles/automatic_repr_showme_1.txt index d0fb199ab..ea149a04d 100644 --- a/test/txtfiles/automatic_repr_showme_1.txt +++ b/test/txtfiles/automatic_repr_showme_1.txt @@ -1,22 +1,22 @@ ──────────────────────────────────────────────────────────────────────────────── - ╭──── @showme ─────────────────────────────────────────────────────────╮ - │ Showing definition for method called by: `tprint(stdout, "test")` │ - ╰──────────────────────────────────────────────────────────────────────╯ + ╭──── @showme ─────────────────────────────────────────────────────────╮ + │ Showing definition for method called by: `tprint(stdout, "test")` │ + ╰──────────────────────────────────────────────────────────────────────╯ -Arguments - ⨀ stdout::Symbol - ⨀ "test"::String +Arguments + ⨀ stdout::Symbol + ⨀ "test"::String Method definition -┌────────────────────────────────────────────────────────────────────┐ -│ function tprint(io::IO, x::AbstractString; highlight = true)  │ -│  x = (highlight ? apply_style ∘ highlighter : apply_style)(x  │ -│ )  │ -│   │ -│  x =  │ -│  Measure(x).w <= console_width(io) ? x :  │ -│  string(RenderableText(string(x), width = console_width(  │ -│ io)))  │ -│  print(io, x)  │ -│ end  │ -└────────────────────────────────────────────────────────────────────┘ \ No newline at end of file +┌────────────────────────────────────────────────────────────────────┐ +│ function tprint(io::IO, x::AbstractString; highlight = true)  │ +│  x = (highlight ? apply_style ∘ highlighter : apply_style)(  │ +│ x)  │ +│   │ +│  x =  │ +│  Measure(x).w <= console_width(io) ? x :  │ +│  string(RenderableText(string(x), width = console_width  │ +│ (io)))  │ +│  print(io, x)  │ +│ end  │ +└────────────────────────────────────────────────────────────────────┘ \ No newline at end of file diff --git a/test/txtfiles/backtrace_1.txt b/test/txtfiles/backtrace_1.txt new file mode 100644 index 000000000..7685fbba9 --- /dev/null +++ b/test/txtfiles/backtrace_1.txt @@ -0,0 +1,27 @@ +╭──── Error Stack ─────────────────────────────────────────────────────────────╮ +│ │ +│ ──────────────────────────── In module Base ──────────────────────────── │ +│ │ +│ ╭───────────────────────────────────────────────────────────╮ │ +│ (1) │ _start() │ │ +│ ╰───────────────────────────────────────────── TOP LEVEL ───╯ │ +│ │ +│ ──────────────────────────────────────────────────────────────────────── │ +│  Skipped 18 frames in Base, Main  │ +│ ──────────────────────────────────────────────────────────────────────── │ +│ │ +│ ──────────────────────────── In module Main ──────────────────────────── │ +│ │ +│ ╭───────────────────────────────────────────────────────────╮ │ +│ │ f0 │ │ +│ │ inlined │ │ +│ │ │ ╭───────────────────────────────────────╮ │ │ +│ │ ╰─│ 104  f1(x) = 3x │ │ │ +│ (20) │ │ 105  f0(x; kwargs...) = begin │ │ │ +│ │ │❯ 106  st = stacktrace() │ │ │ +│ │ │ 107  ctx = StacktraceCont... │ │ │ +│ │ │ 108  bt = render_backtrac... │ │ │ +│ │ ╰───────────── error line ──────────────╯ │ │ +│ ╰──────────────────────────────────────────── ERROR LINE ───╯ │ +│ │ +╰──── Error Stack ─────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/backtrace_2.txt b/test/txtfiles/backtrace_2.txt new file mode 100644 index 000000000..f2be0b1e1 --- /dev/null +++ b/test/txtfiles/backtrace_2.txt @@ -0,0 +1,86 @@ +╭──── Error Stack ─────────────────────────────────────────────────────────────╮ +│ │ +│ ──────────────────────────── In module Base ──────────────────────────── │ +│ │ +│ ╭───────────────────────────────────────────────────────────╮ │ +│ (1) │ _start() │ │ +│ ╰───────────────────────────────────────────── TOP LEVEL ───╯ │ +│ │ +│ (2) exec_options(opts::Base.JLOptions) │ +│ │ +│ (3) eval │ +│ inlined │ +│ │ +│ (4) top-level scope │ +│ │ +│ (5) include(fname::String) │ +│ │ +│ (6) _include(mapexpr::Function, mod::Module, _path::S │ +│ tring) │ +│ │ +│ (7) include_string(mapexpr::typeof(identity), mod::Mo │ +│ dule, code::String, filename::String) │ +│ │ +│ (8) eval │ +│ inlined │ +│ │ +│ top-level scope │ +│ (9) │ ╭────────────────────────────────╮ │ +│ ╰─│❯ 32 @time @timeit_include($fn) │ │ +│ ╰────────────────────────────────╯ │ +│ │ +│ (10) macro expansion │ +│ inlined │ +│ │ +│ macro expansion │ +│ inlined │ +│ (11) │ ╭──────────────────────────╮ │ +│ ╰─│❯ 237 $(Expr(:tryfinally, │ │ +│ ╰──────────────────────────╯ │ +│ │ +│ (12) include │ +│ inlined │ +│ │ +│ (13) _include(mapexpr::Function, mod::Module, _path::S │ +│ tring) │ +│ │ +│ (14) include_string(mapexpr::typeof(identity), mod::Mo │ +│ dule, code::String, filename::String) │ +│ │ +│ (15) eval │ +│ inlined │ +│ │ +│ top-level scope │ +│ (16) │ ╭─────────────────╮ │ +│ ╰─│❯ 103 f2(x) = 2x │ │ +│ ╰─────────────────╯ │ +│ │ +│ (17) macro expansion │ +│ inlined │ +│ │ +│ macro expansion │ +│ inlined │ +│ (18) │ ╭──────────────────────────────────────╮ │ +│ ╰─│❯ 113 bt2 = f0(f2(f1(2)); hide_fra... │ │ +│ ╰──────────────────────────────────────╯ │ +│ │ +│ ──────────────────────────── In module Main ──────────────────────────── │ +│ │ +│ f0#22(x::Int64; hide_frames::Bool) │ +│ (19) │ ╭───────────────────────────────╮ │ +│ ╰─│❯ 105 f0(x; kwargs...) = begin │ │ +│ ╰───────────────────────────────╯ │ +│ │ +│ ╭───────────────────────────────────────────────────────────╮ │ +│ │ f0 │ │ +│ │ inlined │ │ +│ │ │ ╭───────────────────────────────────────╮ │ │ +│ │ ╰─│ 104  f1(x) = 3x │ │ │ +│ (20) │ │ 105  f0(x; kwargs...) = begin │ │ │ +│ │ │❯ 106  st = stacktrace() │ │ │ +│ │ │ 107  ctx = StacktraceCont... │ │ │ +│ │ │ 108  bt = render_backtrac... │ │ │ +│ │ ╰───────────── error line ──────────────╯ │ │ +│ ╰──────────────────────────────────────────── ERROR LINE ───╯ │ +│ │ +╰──── Error Stack ─────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/centered_titile_panel_7.txt b/test/txtfiles/centered_titile_panel_7.txt new file mode 100644 index 000000000..390bdcaf6 --- /dev/null +++ b/test/txtfiles/centered_titile_panel_7.txt @@ -0,0 +1,3 @@ +╭──── test ──────────╮ +│ │ +╰────────── aaaaa ───╯ \ No newline at end of file diff --git a/test/txtfiles/centered_title_panel_1.txt b/test/txtfiles/centered_title_panel_1.txt new file mode 100644 index 000000000..184129a56 --- /dev/null +++ b/test/txtfiles/centered_title_panel_1.txt @@ -0,0 +1,3 @@ +╭──── test ────────────────────────────╮ +│ │ +╰──────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/centered_title_panel_2.txt b/test/txtfiles/centered_title_panel_2.txt new file mode 100644 index 000000000..08ef96817 --- /dev/null +++ b/test/txtfiles/centered_title_panel_2.txt @@ -0,0 +1,3 @@ +╭──────────────── test ────────────────╮ +│ │ +╰──────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/centered_title_panel_3.txt b/test/txtfiles/centered_title_panel_3.txt new file mode 100644 index 000000000..f978c5c40 --- /dev/null +++ b/test/txtfiles/centered_title_panel_3.txt @@ -0,0 +1,3 @@ +╭───────────────────────────── test ───╮ +│ │ +╰──────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/centered_title_panel_4.txt b/test/txtfiles/centered_title_panel_4.txt new file mode 100644 index 000000000..0d1aab507 --- /dev/null +++ b/test/txtfiles/centered_title_panel_4.txt @@ -0,0 +1,3 @@ +╭──── test ──────────────────────────────────────╮ +│ │ +╰────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/centered_title_panel_5.txt b/test/txtfiles/centered_title_panel_5.txt new file mode 100644 index 000000000..651d030d3 --- /dev/null +++ b/test/txtfiles/centered_title_panel_5.txt @@ -0,0 +1,3 @@ +╭───────────────────── test ─────────────────────╮ +│ │ +╰────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/centered_title_panel_6.txt b/test/txtfiles/centered_title_panel_6.txt new file mode 100644 index 000000000..aef3181f7 --- /dev/null +++ b/test/txtfiles/centered_title_panel_6.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────────────── test ───╮ +│ │ +╰────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1.txt b/test/txtfiles/code_highlight_1_1.txt new file mode 100644 index 000000000..5f5303e1c --- /dev/null +++ b/test/txtfiles/code_highlight_1_1.txt @@ -0,0 +1 @@ +{red bold}❯{/red bold} {white}1{/white} import Term.Colors: \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1_1.txt b/test/txtfiles/code_highlight_1_1_1.txt new file mode 100644 index 000000000..d079c55a5 --- /dev/null +++ b/test/txtfiles/code_highlight_1_1_1.txt @@ -0,0 +1,2 @@ +❯ 1 import +Term.Colors: \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1_1_trunc.txt b/test/txtfiles/code_highlight_1_1_1_trunc.txt new file mode 100644 index 000000000..709534373 --- /dev/null +++ b/test/txtfiles/code_highlight_1_1_1_trunc.txt @@ -0,0 +1 @@ +❯ 1 import... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1_2.txt b/test/txtfiles/code_highlight_1_1_2.txt new file mode 100644 index 000000000..1c873eb39 --- /dev/null +++ b/test/txtfiles/code_highlight_1_1_2.txt @@ -0,0 +1 @@ +❯ 1 import Term.Colors: \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1_2_trunc.txt b/test/txtfiles/code_highlight_1_1_2_trunc.txt new file mode 100644 index 000000000..1c873eb39 --- /dev/null +++ b/test/txtfiles/code_highlight_1_1_2_trunc.txt @@ -0,0 +1 @@ +❯ 1 import Term.Colors: \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1_3.txt b/test/txtfiles/code_highlight_1_1_3.txt new file mode 100644 index 000000000..1c873eb39 --- /dev/null +++ b/test/txtfiles/code_highlight_1_1_3.txt @@ -0,0 +1 @@ +❯ 1 import Term.Colors: \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_1_3_trunc.txt b/test/txtfiles/code_highlight_1_1_3_trunc.txt new file mode 100644 index 000000000..1c873eb39 --- /dev/null +++ b/test/txtfiles/code_highlight_1_1_3_trunc.txt @@ -0,0 +1 @@ +❯ 1 import Term.Colors: \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2.txt b/test/txtfiles/code_highlight_1_2.txt new file mode 100644 index 000000000..0bd7897cd --- /dev/null +++ b/test/txtfiles/code_highlight_1_2.txt @@ -0,0 +1,2 @@ +{red bold}❯{/red bold} {white}1{/white} import Term.Colors: + {grey39}2{/grey39}  is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2_1.txt b/test/txtfiles/code_highlight_1_2_1.txt new file mode 100644 index 000000000..94d19eece --- /dev/null +++ b/test/txtfiles/code_highlight_1_2_1.txt @@ -0,0 +1,4 @@ +❯ 1 import +Term.Colors: + 2  is_name +d_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2_1_trunc.txt b/test/txtfiles/code_highlight_1_2_1_trunc.txt new file mode 100644 index 000000000..e3e374add --- /dev/null +++ b/test/txtfiles/code_highlight_1_2_1_trunc.txt @@ -0,0 +1,2 @@ +❯ 1 import... + 2 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2_2.txt b/test/txtfiles/code_highlight_1_2_2.txt new file mode 100644 index 000000000..392f0d821 --- /dev/null +++ b/test/txtfiles/code_highlight_1_2_2.txt @@ -0,0 +1,2 @@ +❯ 1 import Term.Colors: + 2  is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2_2_trunc.txt b/test/txtfiles/code_highlight_1_2_2_trunc.txt new file mode 100644 index 000000000..392f0d821 --- /dev/null +++ b/test/txtfiles/code_highlight_1_2_2_trunc.txt @@ -0,0 +1,2 @@ +❯ 1 import Term.Colors: + 2  is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2_3.txt b/test/txtfiles/code_highlight_1_2_3.txt new file mode 100644 index 000000000..392f0d821 --- /dev/null +++ b/test/txtfiles/code_highlight_1_2_3.txt @@ -0,0 +1,2 @@ +❯ 1 import Term.Colors: + 2  is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_2_3_trunc.txt b/test/txtfiles/code_highlight_1_2_3_trunc.txt new file mode 100644 index 000000000..392f0d821 --- /dev/null +++ b/test/txtfiles/code_highlight_1_2_3_trunc.txt @@ -0,0 +1,2 @@ +❯ 1 import Term.Colors: + 2  is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3.txt b/test/txtfiles/code_highlight_1_3.txt new file mode 100644 index 000000000..95a8a0629 --- /dev/null +++ b/test/txtfiles/code_highlight_1_3.txt @@ -0,0 +1,4 @@ +{red bold}❯{/red bold} {white}1{/white} import Term.Colors: + {grey39}2{/grey39}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, + {grey39}4{/grey39}  is_hex_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3_1.txt b/test/txtfiles/code_highlight_1_3_1.txt new file mode 100644 index 000000000..61dcadc29 --- /dev/null +++ b/test/txtfiles/code_highlight_1_3_1.txt @@ -0,0 +1,8 @@ +❯ 1 import +Term.Colors: + 2  is_name +d_color, + 3  is_rgb_ +color, + 4  is_hex_ +color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3_1_trunc.txt b/test/txtfiles/code_highlight_1_3_1_trunc.txt new file mode 100644 index 000000000..b46683383 --- /dev/null +++ b/test/txtfiles/code_highlight_1_3_1_trunc.txt @@ -0,0 +1,4 @@ +❯ 1 import... + 2 ... + 3 ... + 4 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3_2.txt b/test/txtfiles/code_highlight_1_3_2.txt new file mode 100644 index 000000000..05cc134ee --- /dev/null +++ b/test/txtfiles/code_highlight_1_3_2.txt @@ -0,0 +1,4 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3_2_trunc.txt b/test/txtfiles/code_highlight_1_3_2_trunc.txt new file mode 100644 index 000000000..05cc134ee --- /dev/null +++ b/test/txtfiles/code_highlight_1_3_2_trunc.txt @@ -0,0 +1,4 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3_3.txt b/test/txtfiles/code_highlight_1_3_3.txt new file mode 100644 index 000000000..05cc134ee --- /dev/null +++ b/test/txtfiles/code_highlight_1_3_3.txt @@ -0,0 +1,4 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_3_3_trunc.txt b/test/txtfiles/code_highlight_1_3_3_trunc.txt new file mode 100644 index 000000000..05cc134ee --- /dev/null +++ b/test/txtfiles/code_highlight_1_3_3_trunc.txt @@ -0,0 +1,4 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4.txt b/test/txtfiles/code_highlight_1_4.txt new file mode 100644 index 000000000..e132e099b --- /dev/null +++ b/test/txtfiles/code_highlight_1_4.txt @@ -0,0 +1,6 @@ +{red bold}❯{/red bold} {white}1{/white} import Term.Colors: + {grey39}2{/grey39}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, + {grey39}4{/grey39}  is_hex_color, + {grey39}5{/grey39}  is_color, + {grey39}6{/grey39}  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4_1.txt b/test/txtfiles/code_highlight_1_4_1.txt new file mode 100644 index 000000000..f40141db4 --- /dev/null +++ b/test/txtfiles/code_highlight_1_4_1.txt @@ -0,0 +1,12 @@ +❯ 1 import +Term.Colors: + 2  is_name +d_color, + 3  is_rgb_ +color, + 4  is_hex_ +color, + 5  is_colo +r, + 6  is_back +ground, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4_1_trunc.txt b/test/txtfiles/code_highlight_1_4_1_trunc.txt new file mode 100644 index 000000000..1d56a592e --- /dev/null +++ b/test/txtfiles/code_highlight_1_4_1_trunc.txt @@ -0,0 +1,6 @@ +❯ 1 import... + 2 ... + 3 ... + 4 ... + 5 ... + 6 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4_2.txt b/test/txtfiles/code_highlight_1_4_2.txt new file mode 100644 index 000000000..817f0b18e --- /dev/null +++ b/test/txtfiles/code_highlight_1_4_2.txt @@ -0,0 +1,6 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4_2_trunc.txt b/test/txtfiles/code_highlight_1_4_2_trunc.txt new file mode 100644 index 000000000..817f0b18e --- /dev/null +++ b/test/txtfiles/code_highlight_1_4_2_trunc.txt @@ -0,0 +1,6 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4_3.txt b/test/txtfiles/code_highlight_1_4_3.txt new file mode 100644 index 000000000..817f0b18e --- /dev/null +++ b/test/txtfiles/code_highlight_1_4_3.txt @@ -0,0 +1,6 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_1_4_3_trunc.txt b/test/txtfiles/code_highlight_1_4_3_trunc.txt new file mode 100644 index 000000000..817f0b18e --- /dev/null +++ b/test/txtfiles/code_highlight_1_4_3_trunc.txt @@ -0,0 +1,6 @@ +❯ 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1.txt b/test/txtfiles/code_highlight_2_1.txt new file mode 100644 index 000000000..91e799a30 --- /dev/null +++ b/test/txtfiles/code_highlight_2_1.txt @@ -0,0 +1 @@ +{red bold}❯{/red bold} {white}2{/white} is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1_1.txt b/test/txtfiles/code_highlight_2_1_1.txt new file mode 100644 index 000000000..6ecb53dfe --- /dev/null +++ b/test/txtfiles/code_highlight_2_1_1.txt @@ -0,0 +1,2 @@ +❯ 2 is_named_co +lor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1_1_trunc.txt b/test/txtfiles/code_highlight_2_1_1_trunc.txt new file mode 100644 index 000000000..c35edd3ce --- /dev/null +++ b/test/txtfiles/code_highlight_2_1_1_trunc.txt @@ -0,0 +1 @@ +❯ 2 is_named... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1_2.txt b/test/txtfiles/code_highlight_2_1_2.txt new file mode 100644 index 000000000..6000918bc --- /dev/null +++ b/test/txtfiles/code_highlight_2_1_2.txt @@ -0,0 +1 @@ +❯ 2 is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1_2_trunc.txt b/test/txtfiles/code_highlight_2_1_2_trunc.txt new file mode 100644 index 000000000..6000918bc --- /dev/null +++ b/test/txtfiles/code_highlight_2_1_2_trunc.txt @@ -0,0 +1 @@ +❯ 2 is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1_3.txt b/test/txtfiles/code_highlight_2_1_3.txt new file mode 100644 index 000000000..6000918bc --- /dev/null +++ b/test/txtfiles/code_highlight_2_1_3.txt @@ -0,0 +1 @@ +❯ 2 is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_1_3_trunc.txt b/test/txtfiles/code_highlight_2_1_3_trunc.txt new file mode 100644 index 000000000..6000918bc --- /dev/null +++ b/test/txtfiles/code_highlight_2_1_3_trunc.txt @@ -0,0 +1 @@ +❯ 2 is_named_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2.txt b/test/txtfiles/code_highlight_2_2.txt new file mode 100644 index 000000000..4781b873d --- /dev/null +++ b/test/txtfiles/code_highlight_2_2.txt @@ -0,0 +1,3 @@ + {grey39}1{/grey39} import Term.Colors: +{red bold}❯{/red bold} {white}2{/white}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2_1.txt b/test/txtfiles/code_highlight_2_2_1.txt new file mode 100644 index 000000000..8362e45e6 --- /dev/null +++ b/test/txtfiles/code_highlight_2_2_1.txt @@ -0,0 +1,6 @@ + 1 import +Term.Colors: +❯ 2  is_name +d_color, + 3  is_rgb_ +color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2_1_trunc.txt b/test/txtfiles/code_highlight_2_2_1_trunc.txt new file mode 100644 index 000000000..6291654bc --- /dev/null +++ b/test/txtfiles/code_highlight_2_2_1_trunc.txt @@ -0,0 +1,3 @@ + 1 import... +❯ 2 ... + 3 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2_2.txt b/test/txtfiles/code_highlight_2_2_2.txt new file mode 100644 index 000000000..be80c931e --- /dev/null +++ b/test/txtfiles/code_highlight_2_2_2.txt @@ -0,0 +1,3 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2_2_trunc.txt b/test/txtfiles/code_highlight_2_2_2_trunc.txt new file mode 100644 index 000000000..be80c931e --- /dev/null +++ b/test/txtfiles/code_highlight_2_2_2_trunc.txt @@ -0,0 +1,3 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2_3.txt b/test/txtfiles/code_highlight_2_2_3.txt new file mode 100644 index 000000000..be80c931e --- /dev/null +++ b/test/txtfiles/code_highlight_2_2_3.txt @@ -0,0 +1,3 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_2_3_trunc.txt b/test/txtfiles/code_highlight_2_2_3_trunc.txt new file mode 100644 index 000000000..be80c931e --- /dev/null +++ b/test/txtfiles/code_highlight_2_2_3_trunc.txt @@ -0,0 +1,3 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3.txt b/test/txtfiles/code_highlight_2_3.txt new file mode 100644 index 000000000..af59e9a41 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3.txt @@ -0,0 +1,5 @@ + {grey39}1{/grey39} import Term.Colors: +{red bold}❯{/red bold} {white}2{/white}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, + {grey39}4{/grey39}  is_hex_color, + {grey39}5{/grey39}  is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3_1.txt b/test/txtfiles/code_highlight_2_3_1.txt new file mode 100644 index 000000000..761380879 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3_1.txt @@ -0,0 +1,10 @@ + 1 import +Term.Colors: +❯ 2  is_name +d_color, + 3  is_rgb_ +color, + 4  is_hex_ +color, + 5  is_colo +r, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3_1_trunc.txt b/test/txtfiles/code_highlight_2_3_1_trunc.txt new file mode 100644 index 000000000..b809feb20 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3_1_trunc.txt @@ -0,0 +1,5 @@ + 1 import... +❯ 2 ... + 3 ... + 4 ... + 5 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3_2.txt b/test/txtfiles/code_highlight_2_3_2.txt new file mode 100644 index 000000000..8c4beca34 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3_2.txt @@ -0,0 +1,5 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3_2_trunc.txt b/test/txtfiles/code_highlight_2_3_2_trunc.txt new file mode 100644 index 000000000..8c4beca34 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3_2_trunc.txt @@ -0,0 +1,5 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3_3.txt b/test/txtfiles/code_highlight_2_3_3.txt new file mode 100644 index 000000000..8c4beca34 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3_3.txt @@ -0,0 +1,5 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_3_3_trunc.txt b/test/txtfiles/code_highlight_2_3_3_trunc.txt new file mode 100644 index 000000000..8c4beca34 --- /dev/null +++ b/test/txtfiles/code_highlight_2_3_3_trunc.txt @@ -0,0 +1,5 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4.txt b/test/txtfiles/code_highlight_2_4.txt new file mode 100644 index 000000000..8cb2ccc4b --- /dev/null +++ b/test/txtfiles/code_highlight_2_4.txt @@ -0,0 +1,7 @@ + {grey39}1{/grey39} import Term.Colors: +{red bold}❯{/red bold} {white}2{/white}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, + {grey39}4{/grey39}  is_hex_color, + {grey39}5{/grey39}  is_color, + {grey39}6{/grey39}  is_background, + {grey39}7{/grey39}  get_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4_1.txt b/test/txtfiles/code_highlight_2_4_1.txt new file mode 100644 index 000000000..7632564e4 --- /dev/null +++ b/test/txtfiles/code_highlight_2_4_1.txt @@ -0,0 +1,14 @@ + 1 import +Term.Colors: +❯ 2  is_name +d_color, + 3  is_rgb_ +color, + 4  is_hex_ +color, + 5  is_colo +r, + 6  is_back +ground, + 7  get_col +or, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4_1_trunc.txt b/test/txtfiles/code_highlight_2_4_1_trunc.txt new file mode 100644 index 000000000..7f12a1171 --- /dev/null +++ b/test/txtfiles/code_highlight_2_4_1_trunc.txt @@ -0,0 +1,7 @@ + 1 import... +❯ 2 ... + 3 ... + 4 ... + 5 ... + 6 ... + 7 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4_2.txt b/test/txtfiles/code_highlight_2_4_2.txt new file mode 100644 index 000000000..2fb2182ef --- /dev/null +++ b/test/txtfiles/code_highlight_2_4_2.txt @@ -0,0 +1,7 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, + 7  get_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4_2_trunc.txt b/test/txtfiles/code_highlight_2_4_2_trunc.txt new file mode 100644 index 000000000..2fb2182ef --- /dev/null +++ b/test/txtfiles/code_highlight_2_4_2_trunc.txt @@ -0,0 +1,7 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, + 7  get_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4_3.txt b/test/txtfiles/code_highlight_2_4_3.txt new file mode 100644 index 000000000..2fb2182ef --- /dev/null +++ b/test/txtfiles/code_highlight_2_4_3.txt @@ -0,0 +1,7 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, + 7  get_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_2_4_3_trunc.txt b/test/txtfiles/code_highlight_2_4_3_trunc.txt new file mode 100644 index 000000000..2fb2182ef --- /dev/null +++ b/test/txtfiles/code_highlight_2_4_3_trunc.txt @@ -0,0 +1,7 @@ + 1 import Term.Colors: +❯ 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, + 5  is_color, + 6  is_background, + 7  get_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1.txt b/test/txtfiles/code_highlight_3_1.txt new file mode 100644 index 000000000..f0a33eb6e --- /dev/null +++ b/test/txtfiles/code_highlight_3_1.txt @@ -0,0 +1 @@ +{red bold}❯{/red bold} {white}5{/white} is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1_1.txt b/test/txtfiles/code_highlight_3_1_1.txt new file mode 100644 index 000000000..34c2156f0 --- /dev/null +++ b/test/txtfiles/code_highlight_3_1_1.txt @@ -0,0 +1 @@ +❯ 5 is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1_1_trunc.txt b/test/txtfiles/code_highlight_3_1_1_trunc.txt new file mode 100644 index 000000000..34c2156f0 --- /dev/null +++ b/test/txtfiles/code_highlight_3_1_1_trunc.txt @@ -0,0 +1 @@ +❯ 5 is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1_2.txt b/test/txtfiles/code_highlight_3_1_2.txt new file mode 100644 index 000000000..34c2156f0 --- /dev/null +++ b/test/txtfiles/code_highlight_3_1_2.txt @@ -0,0 +1 @@ +❯ 5 is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1_2_trunc.txt b/test/txtfiles/code_highlight_3_1_2_trunc.txt new file mode 100644 index 000000000..34c2156f0 --- /dev/null +++ b/test/txtfiles/code_highlight_3_1_2_trunc.txt @@ -0,0 +1 @@ +❯ 5 is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1_3.txt b/test/txtfiles/code_highlight_3_1_3.txt new file mode 100644 index 000000000..34c2156f0 --- /dev/null +++ b/test/txtfiles/code_highlight_3_1_3.txt @@ -0,0 +1 @@ +❯ 5 is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_1_3_trunc.txt b/test/txtfiles/code_highlight_3_1_3_trunc.txt new file mode 100644 index 000000000..34c2156f0 --- /dev/null +++ b/test/txtfiles/code_highlight_3_1_3_trunc.txt @@ -0,0 +1 @@ +❯ 5 is_color, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2.txt b/test/txtfiles/code_highlight_3_2.txt new file mode 100644 index 000000000..c9cd9e50f --- /dev/null +++ b/test/txtfiles/code_highlight_3_2.txt @@ -0,0 +1,3 @@ + {grey39}4{/grey39}  is_hex_color, +{red bold}❯{/red bold} {white}5{/white}  is_color, + {grey39}6{/grey39}  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2_1.txt b/test/txtfiles/code_highlight_3_2_1.txt new file mode 100644 index 000000000..73b6a901a --- /dev/null +++ b/test/txtfiles/code_highlight_3_2_1.txt @@ -0,0 +1,6 @@ + 4  is_hex_ +color, +❯ 5  is_colo +r, + 6  is_back +ground, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2_1_trunc.txt b/test/txtfiles/code_highlight_3_2_1_trunc.txt new file mode 100644 index 000000000..abda300c9 --- /dev/null +++ b/test/txtfiles/code_highlight_3_2_1_trunc.txt @@ -0,0 +1,3 @@ + 4 ... +❯ 5 ... + 6 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2_2.txt b/test/txtfiles/code_highlight_3_2_2.txt new file mode 100644 index 000000000..c8c46d306 --- /dev/null +++ b/test/txtfiles/code_highlight_3_2_2.txt @@ -0,0 +1,3 @@ + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2_2_trunc.txt b/test/txtfiles/code_highlight_3_2_2_trunc.txt new file mode 100644 index 000000000..c8c46d306 --- /dev/null +++ b/test/txtfiles/code_highlight_3_2_2_trunc.txt @@ -0,0 +1,3 @@ + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2_3.txt b/test/txtfiles/code_highlight_3_2_3.txt new file mode 100644 index 000000000..c8c46d306 --- /dev/null +++ b/test/txtfiles/code_highlight_3_2_3.txt @@ -0,0 +1,3 @@ + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_2_3_trunc.txt b/test/txtfiles/code_highlight_3_2_3_trunc.txt new file mode 100644 index 000000000..c8c46d306 --- /dev/null +++ b/test/txtfiles/code_highlight_3_2_3_trunc.txt @@ -0,0 +1,3 @@ + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3.txt b/test/txtfiles/code_highlight_3_3.txt new file mode 100644 index 000000000..3b4708d61 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3.txt @@ -0,0 +1,7 @@ + {grey39}2{/grey39}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, + {grey39}4{/grey39}  is_hex_color, +{red bold}❯{/red bold} {white}5{/white}  is_color, + {grey39}6{/grey39}  is_background, + {grey39}7{/grey39}  get_color, + {grey39}8{/grey39}  NamedColor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3_1.txt b/test/txtfiles/code_highlight_3_3_1.txt new file mode 100644 index 000000000..1742ad8a6 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3_1.txt @@ -0,0 +1,14 @@ + 2  is_name +d_color, + 3  is_rgb_ +color, + 4  is_hex_ +color, +❯ 5  is_colo +r, + 6  is_back +ground, + 7  get_col +or, + 8  NamedCo +lor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3_1_trunc.txt b/test/txtfiles/code_highlight_3_3_1_trunc.txt new file mode 100644 index 000000000..a79c8d7e1 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3_1_trunc.txt @@ -0,0 +1,7 @@ + 2 ... + 3 ... + 4 ... +❯ 5 ... + 6 ... + 7 ... + 8 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3_2.txt b/test/txtfiles/code_highlight_3_3_2.txt new file mode 100644 index 000000000..149fd3896 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3_2.txt @@ -0,0 +1,7 @@ + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3_2_trunc.txt b/test/txtfiles/code_highlight_3_3_2_trunc.txt new file mode 100644 index 000000000..149fd3896 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3_2_trunc.txt @@ -0,0 +1,7 @@ + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3_3.txt b/test/txtfiles/code_highlight_3_3_3.txt new file mode 100644 index 000000000..149fd3896 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3_3.txt @@ -0,0 +1,7 @@ + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_3_3_trunc.txt b/test/txtfiles/code_highlight_3_3_3_trunc.txt new file mode 100644 index 000000000..149fd3896 --- /dev/null +++ b/test/txtfiles/code_highlight_3_3_3_trunc.txt @@ -0,0 +1,7 @@ + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4.txt b/test/txtfiles/code_highlight_3_4.txt new file mode 100644 index 000000000..2dc8a84c8 --- /dev/null +++ b/test/txtfiles/code_highlight_3_4.txt @@ -0,0 +1,10 @@ + {grey39}1{/grey39} import Term.Colors: + {grey39}2{/grey39}  is_named_color, + {grey39}3{/grey39}  is_rgb_color, + {grey39}4{/grey39}  is_hex_color, +{red bold}❯{/red bold} {white}5{/white}  is_color, + {grey39}6{/grey39}  is_background, + {grey39}7{/grey39}  get_color, + {grey39}8{/grey39}  NamedColor, + {grey39}9{/grey39}  RGBColor, + {grey39}10{/grey39}  BitColor \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4_1.txt b/test/txtfiles/code_highlight_3_4_1.txt new file mode 100644 index 000000000..d54278753 --- /dev/null +++ b/test/txtfiles/code_highlight_3_4_1.txt @@ -0,0 +1,20 @@ + 1 import +Term.Colors: + 2  is_name +d_color, + 3  is_rgb_ +color, + 4  is_hex_ +color, +❯ 5  is_colo +r, + 6  is_back +ground, + 7  get_col +or, + 8  NamedCo +lor, + 9  RGBColo +r, + 10  BitCol +or \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4_1_trunc.txt b/test/txtfiles/code_highlight_3_4_1_trunc.txt new file mode 100644 index 000000000..8b55cf4ac --- /dev/null +++ b/test/txtfiles/code_highlight_3_4_1_trunc.txt @@ -0,0 +1,10 @@ + 1 import... + 2 ... + 3 ... + 4 ... +❯ 5 ... + 6 ... + 7 ... + 8 ... + 9 ... + 10 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4_2.txt b/test/txtfiles/code_highlight_3_4_2.txt new file mode 100644 index 000000000..048193a6c --- /dev/null +++ b/test/txtfiles/code_highlight_3_4_2.txt @@ -0,0 +1,10 @@ + 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, + 9  RGBColor, + 10  BitColor \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4_2_trunc.txt b/test/txtfiles/code_highlight_3_4_2_trunc.txt new file mode 100644 index 000000000..048193a6c --- /dev/null +++ b/test/txtfiles/code_highlight_3_4_2_trunc.txt @@ -0,0 +1,10 @@ + 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, + 9  RGBColor, + 10  BitColor \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4_3.txt b/test/txtfiles/code_highlight_3_4_3.txt new file mode 100644 index 000000000..048193a6c --- /dev/null +++ b/test/txtfiles/code_highlight_3_4_3.txt @@ -0,0 +1,10 @@ + 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, + 9  RGBColor, + 10  BitColor \ No newline at end of file diff --git a/test/txtfiles/code_highlight_3_4_3_trunc.txt b/test/txtfiles/code_highlight_3_4_3_trunc.txt new file mode 100644 index 000000000..048193a6c --- /dev/null +++ b/test/txtfiles/code_highlight_3_4_3_trunc.txt @@ -0,0 +1,10 @@ + 1 import Term.Colors: + 2  is_named_color, + 3  is_rgb_color, + 4  is_hex_color, +❯ 5  is_color, + 6  is_background, + 7  get_color, + 8  NamedColor, + 9  RGBColor, + 10  BitColor \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1.txt b/test/txtfiles/code_highlight_4_1.txt new file mode 100644 index 000000000..09857d727 --- /dev/null +++ b/test/txtfiles/code_highlight_4_1.txt @@ -0,0 +1 @@ +{red bold}❯{/red bold} {white}90{/white} for hex in hexes \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1_1.txt b/test/txtfiles/code_highlight_4_1_1.txt new file mode 100644 index 000000000..031a85367 --- /dev/null +++ b/test/txtfiles/code_highlight_4_1_1.txt @@ -0,0 +1,2 @@ +❯ 90 for hex +in hexes \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1_1_trunc.txt b/test/txtfiles/code_highlight_4_1_1_trunc.txt new file mode 100644 index 000000000..e149ef954 --- /dev/null +++ b/test/txtfiles/code_highlight_4_1_1_trunc.txt @@ -0,0 +1 @@ +❯ 90 for... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1_2.txt b/test/txtfiles/code_highlight_4_1_2.txt new file mode 100644 index 000000000..12017c4df --- /dev/null +++ b/test/txtfiles/code_highlight_4_1_2.txt @@ -0,0 +1 @@ +❯ 90 for hex in hexes \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1_2_trunc.txt b/test/txtfiles/code_highlight_4_1_2_trunc.txt new file mode 100644 index 000000000..12017c4df --- /dev/null +++ b/test/txtfiles/code_highlight_4_1_2_trunc.txt @@ -0,0 +1 @@ +❯ 90 for hex in hexes \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1_3.txt b/test/txtfiles/code_highlight_4_1_3.txt new file mode 100644 index 000000000..12017c4df --- /dev/null +++ b/test/txtfiles/code_highlight_4_1_3.txt @@ -0,0 +1 @@ +❯ 90 for hex in hexes \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_1_3_trunc.txt b/test/txtfiles/code_highlight_4_1_3_trunc.txt new file mode 100644 index 000000000..12017c4df --- /dev/null +++ b/test/txtfiles/code_highlight_4_1_3_trunc.txt @@ -0,0 +1 @@ +❯ 90 for hex in hexes \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2.txt b/test/txtfiles/code_highlight_4_2.txt new file mode 100644 index 000000000..389e2d9f9 --- /dev/null +++ b/test/txtfiles/code_highlight_4_2.txt @@ -0,0 +1,3 @@ + {grey39}89{/grey39}  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#123123"] +{red bold}❯{/red bold} {white}90{/white}  for hex in hexes + {grey39}91{/grey39}  @test is_background(hex) \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2_1.txt b/test/txtfiles/code_highlight_4_2_1.txt new file mode 100644 index 000000000..a4f7baf77 --- /dev/null +++ b/test/txtfiles/code_highlight_4_2_1.txt @@ -0,0 +1,10 @@ + 89  hexes += ["on_#ffffff" +, "on_#000000", + "on_#dada2a", +"on_#123123"] +❯ 90  for +hex in hexes + 91  + @test is_bac +kground(hex) \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2_1_trunc.txt b/test/txtfiles/code_highlight_4_2_1_trunc.txt new file mode 100644 index 000000000..90dd25356 --- /dev/null +++ b/test/txtfiles/code_highlight_4_2_1_trunc.txt @@ -0,0 +1,3 @@ + 89 ... +❯ 90 ... + 91 ... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2_2.txt b/test/txtfiles/code_highlight_4_2_2.txt new file mode 100644 index 000000000..e2b3ab080 --- /dev/null +++ b/test/txtfiles/code_highlight_4_2_2.txt @@ -0,0 +1,6 @@ + 89  hexes = ["on_#ffffff", +"on_#000000", "on_#dada2a", +"on_#123123"] +❯ 90  for hex in hexes + 91  @test is_background( +hex) \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2_2_trunc.txt b/test/txtfiles/code_highlight_4_2_2_trunc.txt new file mode 100644 index 000000000..f57658992 --- /dev/null +++ b/test/txtfiles/code_highlight_4_2_2_trunc.txt @@ -0,0 +1,3 @@ + 89  hexes = ["on_#ffffff"... +❯ 90  for hex in hexes + 91  @test is_backgrou... \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2_3.txt b/test/txtfiles/code_highlight_4_2_3.txt new file mode 100644 index 000000000..e1b3de3cf --- /dev/null +++ b/test/txtfiles/code_highlight_4_2_3.txt @@ -0,0 +1,4 @@ + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#12 +3123"] +❯ 90  for hex in hexes + 91  @test is_background(hex) \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_2_3_trunc.txt b/test/txtfiles/code_highlight_4_2_3_trunc.txt new file mode 100644 index 000000000..a6ffdfc18 --- /dev/null +++ b/test/txtfiles/code_highlight_4_2_3_trunc.txt @@ -0,0 +1,3 @@ + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a",... +❯ 90  for hex in hexes + 91  @test is_background(hex) \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3.txt b/test/txtfiles/code_highlight_4_3.txt new file mode 100644 index 000000000..eb747b442 --- /dev/null +++ b/test/txtfiles/code_highlight_4_3.txt @@ -0,0 +1,7 @@ + {grey39}87{/grey39}  end + {grey39}88{/grey39}  + {grey39}89{/grey39}  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#123123"] +{red bold}❯{/red bold} {white}90{/white}  for hex in hexes + {grey39}91{/grey39}  @test is_background(hex) + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor + {grey39}93{/grey39}  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3_1.txt b/test/txtfiles/code_highlight_4_3_1.txt new file mode 100644 index 000000000..0bb1a8766 --- /dev/null +++ b/test/txtfiles/code_highlight_4_3_1.txt @@ -0,0 +1,18 @@ + 87  end + 88  + 89  hexes += ["on_#ffffff" +, "on_#000000", + "on_#dada2a", +"on_#123123"] +❯ 90  for +hex in hexes + 91  + @test is_bac +kground(hex) + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor + 93  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3_1_trunc.txt b/test/txtfiles/code_highlight_4_3_1_trunc.txt new file mode 100644 index 000000000..b5ca96149 --- /dev/null +++ b/test/txtfiles/code_highlight_4_3_1_trunc.txt @@ -0,0 +1,7 @@ + 87  end + 88  + 89 ... +❯ 90 ... + 91 ... + 92 ... + 93  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3_2.txt b/test/txtfiles/code_highlight_4_3_2.txt new file mode 100644 index 000000000..fd8409a88 --- /dev/null +++ b/test/txtfiles/code_highlight_4_3_2.txt @@ -0,0 +1,11 @@ + 87  end + 88  + 89  hexes = ["on_#ffffff", +"on_#000000", "on_#dada2a", +"on_#123123"] +❯ 90  for hex in hexes + 91  @test is_background( +hex) + 92  @test get_color(hex; + bg = true) isa RGBColor + 93  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3_2_trunc.txt b/test/txtfiles/code_highlight_4_3_2_trunc.txt new file mode 100644 index 000000000..8891105bf --- /dev/null +++ b/test/txtfiles/code_highlight_4_3_2_trunc.txt @@ -0,0 +1,7 @@ + 87  end + 88  + 89  hexes = ["on_#ffffff"... +❯ 90  for hex in hexes + 91  @test is_backgrou... + 92  @test get_color(h... + 93  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3_3.txt b/test/txtfiles/code_highlight_4_3_3.txt new file mode 100644 index 000000000..34061b9f4 --- /dev/null +++ b/test/txtfiles/code_highlight_4_3_3.txt @@ -0,0 +1,8 @@ + 87  end + 88  + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#12 +3123"] +❯ 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_3_3_trunc.txt b/test/txtfiles/code_highlight_4_3_3_trunc.txt new file mode 100644 index 000000000..505651e02 --- /dev/null +++ b/test/txtfiles/code_highlight_4_3_3_trunc.txt @@ -0,0 +1,7 @@ + 87  end + 88  + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a",... +❯ 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4.txt b/test/txtfiles/code_highlight_4_4.txt new file mode 100644 index 000000000..91a1b9979 --- /dev/null +++ b/test/txtfiles/code_highlight_4_4.txt @@ -0,0 +1,10 @@ + {grey39}85{/grey39}  @test !is_color(rgb) + {grey39}86{/grey39}  @test get_color(rgb; bg = true) isa RGBColor + {grey39}87{/grey39}  end + {grey39}88{/grey39}  + {grey39}89{/grey39}  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#123123"] +{red bold}❯{/red bold} {white}90{/white}  for hex in hexes + {grey39}91{/grey39}  @test is_background(hex) + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor + {grey39}93{/grey39}  end + {grey39}94{/grey39} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4_1.txt b/test/txtfiles/code_highlight_4_4_1.txt new file mode 100644 index 000000000..a28c73204 --- /dev/null +++ b/test/txtfiles/code_highlight_4_4_1.txt @@ -0,0 +1,27 @@ + 85  + @test !is_co +lor(rgb) + 86  + @test get_co +lor(rgb; bg += true) isa +RGBColor + 87  end + 88  + 89  hexes += ["on_#ffffff" +, "on_#000000", + "on_#dada2a", +"on_#123123"] +❯ 90  for +hex in hexes + 91  + @test is_bac +kground(hex) + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor + 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4_1_trunc.txt b/test/txtfiles/code_highlight_4_4_1_trunc.txt new file mode 100644 index 000000000..019d45230 --- /dev/null +++ b/test/txtfiles/code_highlight_4_4_1_trunc.txt @@ -0,0 +1,10 @@ + 85 ... + 86 ... + 87  end + 88  + 89 ... +❯ 90 ... + 91 ... + 92 ... + 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4_2.txt b/test/txtfiles/code_highlight_4_4_2.txt new file mode 100644 index 000000000..a413a4b4c --- /dev/null +++ b/test/txtfiles/code_highlight_4_4_2.txt @@ -0,0 +1,15 @@ + 85  @test !is_color(rgb) + 86  @test get_color(rgb; + bg = true) isa RGBColor + 87  end + 88  + 89  hexes = ["on_#ffffff", +"on_#000000", "on_#dada2a", +"on_#123123"] +❯ 90  for hex in hexes + 91  @test is_background( +hex) + 92  @test get_color(hex; + bg = true) isa RGBColor + 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4_2_trunc.txt b/test/txtfiles/code_highlight_4_4_2_trunc.txt new file mode 100644 index 000000000..8afcab8fb --- /dev/null +++ b/test/txtfiles/code_highlight_4_4_2_trunc.txt @@ -0,0 +1,10 @@ + 85  @test !is_color(rgb) + 86  @test get_color(r... + 87  end + 88  + 89  hexes = ["on_#ffffff"... +❯ 90  for hex in hexes + 91  @test is_backgrou... + 92  @test get_color(h... + 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4_3.txt b/test/txtfiles/code_highlight_4_4_3.txt new file mode 100644 index 000000000..420531fd4 --- /dev/null +++ b/test/txtfiles/code_highlight_4_4_3.txt @@ -0,0 +1,11 @@ + 85  @test !is_color(rgb) + 86  @test get_color(rgb; bg = true) isa RGBColor + 87  end + 88  + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#12 +3123"] +❯ 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_4_4_3_trunc.txt b/test/txtfiles/code_highlight_4_4_3_trunc.txt new file mode 100644 index 000000000..2ba72a720 --- /dev/null +++ b/test/txtfiles/code_highlight_4_4_3_trunc.txt @@ -0,0 +1,10 @@ + 85  @test !is_color(rgb) + 86  @test get_color(rgb; bg = true) isa RGBColor + 87  end + 88  + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a",... +❯ 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1.txt b/test/txtfiles/code_highlight_5_1.txt new file mode 100644 index 000000000..8584e69bd --- /dev/null +++ b/test/txtfiles/code_highlight_5_1.txt @@ -0,0 +1 @@ +{red bold}❯{/red bold} {white}93{/white} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1_1.txt b/test/txtfiles/code_highlight_5_1_1.txt new file mode 100644 index 000000000..199a59b45 --- /dev/null +++ b/test/txtfiles/code_highlight_5_1_1.txt @@ -0,0 +1 @@ +❯ 93 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1_1_trunc.txt b/test/txtfiles/code_highlight_5_1_1_trunc.txt new file mode 100644 index 000000000..199a59b45 --- /dev/null +++ b/test/txtfiles/code_highlight_5_1_1_trunc.txt @@ -0,0 +1 @@ +❯ 93 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1_2.txt b/test/txtfiles/code_highlight_5_1_2.txt new file mode 100644 index 000000000..199a59b45 --- /dev/null +++ b/test/txtfiles/code_highlight_5_1_2.txt @@ -0,0 +1 @@ +❯ 93 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1_2_trunc.txt b/test/txtfiles/code_highlight_5_1_2_trunc.txt new file mode 100644 index 000000000..199a59b45 --- /dev/null +++ b/test/txtfiles/code_highlight_5_1_2_trunc.txt @@ -0,0 +1 @@ +❯ 93 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1_3.txt b/test/txtfiles/code_highlight_5_1_3.txt new file mode 100644 index 000000000..199a59b45 --- /dev/null +++ b/test/txtfiles/code_highlight_5_1_3.txt @@ -0,0 +1 @@ +❯ 93 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_1_3_trunc.txt b/test/txtfiles/code_highlight_5_1_3_trunc.txt new file mode 100644 index 000000000..199a59b45 --- /dev/null +++ b/test/txtfiles/code_highlight_5_1_3_trunc.txt @@ -0,0 +1 @@ +❯ 93 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2.txt b/test/txtfiles/code_highlight_5_2.txt new file mode 100644 index 000000000..d8a004ee9 --- /dev/null +++ b/test/txtfiles/code_highlight_5_2.txt @@ -0,0 +1,3 @@ + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor +{red bold}❯{/red bold} {white}93{/white}  end + {grey39}94{/grey39} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2_1.txt b/test/txtfiles/code_highlight_5_2_1.txt new file mode 100644 index 000000000..2569e0470 --- /dev/null +++ b/test/txtfiles/code_highlight_5_2_1.txt @@ -0,0 +1,7 @@ + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2_1_trunc.txt b/test/txtfiles/code_highlight_5_2_1_trunc.txt new file mode 100644 index 000000000..e2f39235f --- /dev/null +++ b/test/txtfiles/code_highlight_5_2_1_trunc.txt @@ -0,0 +1,3 @@ + 92 ... +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2_2.txt b/test/txtfiles/code_highlight_5_2_2.txt new file mode 100644 index 000000000..854bc4e8d --- /dev/null +++ b/test/txtfiles/code_highlight_5_2_2.txt @@ -0,0 +1,4 @@ + 92  @test get_color(hex; + bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2_2_trunc.txt b/test/txtfiles/code_highlight_5_2_2_trunc.txt new file mode 100644 index 000000000..9c2b090c7 --- /dev/null +++ b/test/txtfiles/code_highlight_5_2_2_trunc.txt @@ -0,0 +1,3 @@ + 92  @test get_color(h... +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2_3.txt b/test/txtfiles/code_highlight_5_2_3.txt new file mode 100644 index 000000000..35e3bb901 --- /dev/null +++ b/test/txtfiles/code_highlight_5_2_3.txt @@ -0,0 +1,3 @@ + 92  @test get_color(hex; bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_2_3_trunc.txt b/test/txtfiles/code_highlight_5_2_3_trunc.txt new file mode 100644 index 000000000..35e3bb901 --- /dev/null +++ b/test/txtfiles/code_highlight_5_2_3_trunc.txt @@ -0,0 +1,3 @@ + 92  @test get_color(hex; bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3.txt b/test/txtfiles/code_highlight_5_3.txt new file mode 100644 index 000000000..454c44adf --- /dev/null +++ b/test/txtfiles/code_highlight_5_3.txt @@ -0,0 +1,5 @@ + {grey39}90{/grey39}  for hex in hexes + {grey39}91{/grey39}  @test is_background(hex) + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor +{red bold}❯{/red bold} {white}93{/white}  end + {grey39}94{/grey39} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3_1.txt b/test/txtfiles/code_highlight_5_3_1.txt new file mode 100644 index 000000000..bbc32a3a2 --- /dev/null +++ b/test/txtfiles/code_highlight_5_3_1.txt @@ -0,0 +1,12 @@ + 90  for +hex in hexes + 91  + @test is_bac +kground(hex) + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3_1_trunc.txt b/test/txtfiles/code_highlight_5_3_1_trunc.txt new file mode 100644 index 000000000..c59e3135f --- /dev/null +++ b/test/txtfiles/code_highlight_5_3_1_trunc.txt @@ -0,0 +1,5 @@ + 90 ... + 91 ... + 92 ... +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3_2.txt b/test/txtfiles/code_highlight_5_3_2.txt new file mode 100644 index 000000000..449177789 --- /dev/null +++ b/test/txtfiles/code_highlight_5_3_2.txt @@ -0,0 +1,7 @@ + 90  for hex in hexes + 91  @test is_background( +hex) + 92  @test get_color(hex; + bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3_2_trunc.txt b/test/txtfiles/code_highlight_5_3_2_trunc.txt new file mode 100644 index 000000000..3b92f8a6d --- /dev/null +++ b/test/txtfiles/code_highlight_5_3_2_trunc.txt @@ -0,0 +1,5 @@ + 90  for hex in hexes + 91  @test is_backgrou... + 92  @test get_color(h... +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3_3.txt b/test/txtfiles/code_highlight_5_3_3.txt new file mode 100644 index 000000000..65174e1bf --- /dev/null +++ b/test/txtfiles/code_highlight_5_3_3.txt @@ -0,0 +1,5 @@ + 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_3_3_trunc.txt b/test/txtfiles/code_highlight_5_3_3_trunc.txt new file mode 100644 index 000000000..65174e1bf --- /dev/null +++ b/test/txtfiles/code_highlight_5_3_3_trunc.txt @@ -0,0 +1,5 @@ + 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4.txt b/test/txtfiles/code_highlight_5_4.txt new file mode 100644 index 000000000..1fda0bcc9 --- /dev/null +++ b/test/txtfiles/code_highlight_5_4.txt @@ -0,0 +1,7 @@ + {grey39}88{/grey39}  + {grey39}89{/grey39}  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#123123"] + {grey39}90{/grey39}  for hex in hexes + {grey39}91{/grey39}  @test is_background(hex) + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor +{red bold}❯{/red bold} {white}93{/white}  end + {grey39}94{/grey39} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4_1.txt b/test/txtfiles/code_highlight_5_4_1.txt new file mode 100644 index 000000000..d9afa9b82 --- /dev/null +++ b/test/txtfiles/code_highlight_5_4_1.txt @@ -0,0 +1,18 @@ + 88  + 89  hexes += ["on_#ffffff" +, "on_#000000", + "on_#dada2a", +"on_#123123"] + 90  for +hex in hexes + 91  + @test is_bac +kground(hex) + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4_1_trunc.txt b/test/txtfiles/code_highlight_5_4_1_trunc.txt new file mode 100644 index 000000000..c39d2459e --- /dev/null +++ b/test/txtfiles/code_highlight_5_4_1_trunc.txt @@ -0,0 +1,7 @@ + 88  + 89 ... + 90 ... + 91 ... + 92 ... +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4_2.txt b/test/txtfiles/code_highlight_5_4_2.txt new file mode 100644 index 000000000..05b2f8a05 --- /dev/null +++ b/test/txtfiles/code_highlight_5_4_2.txt @@ -0,0 +1,11 @@ + 88  + 89  hexes = ["on_#ffffff", +"on_#000000", "on_#dada2a", +"on_#123123"] + 90  for hex in hexes + 91  @test is_background( +hex) + 92  @test get_color(hex; + bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4_2_trunc.txt b/test/txtfiles/code_highlight_5_4_2_trunc.txt new file mode 100644 index 000000000..b7bdff3da --- /dev/null +++ b/test/txtfiles/code_highlight_5_4_2_trunc.txt @@ -0,0 +1,7 @@ + 88  + 89  hexes = ["on_#ffffff"... + 90  for hex in hexes + 91  @test is_backgrou... + 92  @test get_color(h... +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4_3.txt b/test/txtfiles/code_highlight_5_4_3.txt new file mode 100644 index 000000000..a3302a402 --- /dev/null +++ b/test/txtfiles/code_highlight_5_4_3.txt @@ -0,0 +1,8 @@ + 88  + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#12 +3123"] + 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_5_4_3_trunc.txt b/test/txtfiles/code_highlight_5_4_3_trunc.txt new file mode 100644 index 000000000..919ca5e03 --- /dev/null +++ b/test/txtfiles/code_highlight_5_4_3_trunc.txt @@ -0,0 +1,7 @@ + 88  + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a",... + 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor +❯ 93  end + 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1.txt b/test/txtfiles/code_highlight_6_1.txt new file mode 100644 index 000000000..9995e7682 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1.txt @@ -0,0 +1 @@ +{red bold}❯{/red bold} {white}94{/white} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1_1.txt b/test/txtfiles/code_highlight_6_1_1.txt new file mode 100644 index 000000000..e97282f27 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1_1.txt @@ -0,0 +1 @@ +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1_1_trunc.txt b/test/txtfiles/code_highlight_6_1_1_trunc.txt new file mode 100644 index 000000000..e97282f27 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1_1_trunc.txt @@ -0,0 +1 @@ +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1_2.txt b/test/txtfiles/code_highlight_6_1_2.txt new file mode 100644 index 000000000..e97282f27 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1_2.txt @@ -0,0 +1 @@ +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1_2_trunc.txt b/test/txtfiles/code_highlight_6_1_2_trunc.txt new file mode 100644 index 000000000..e97282f27 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1_2_trunc.txt @@ -0,0 +1 @@ +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1_3.txt b/test/txtfiles/code_highlight_6_1_3.txt new file mode 100644 index 000000000..e97282f27 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1_3.txt @@ -0,0 +1 @@ +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_1_3_trunc.txt b/test/txtfiles/code_highlight_6_1_3_trunc.txt new file mode 100644 index 000000000..e97282f27 --- /dev/null +++ b/test/txtfiles/code_highlight_6_1_3_trunc.txt @@ -0,0 +1 @@ +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2.txt b/test/txtfiles/code_highlight_6_2.txt new file mode 100644 index 000000000..285fcdca0 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2.txt @@ -0,0 +1,2 @@ + {grey39}93{/grey39}  end +{red bold}❯{/red bold} {white}94{/white} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2_1.txt b/test/txtfiles/code_highlight_6_2_1.txt new file mode 100644 index 000000000..2d3e2e404 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2_1.txt @@ -0,0 +1,2 @@ + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2_1_trunc.txt b/test/txtfiles/code_highlight_6_2_1_trunc.txt new file mode 100644 index 000000000..2d3e2e404 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2_1_trunc.txt @@ -0,0 +1,2 @@ + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2_2.txt b/test/txtfiles/code_highlight_6_2_2.txt new file mode 100644 index 000000000..2d3e2e404 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2_2.txt @@ -0,0 +1,2 @@ + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2_2_trunc.txt b/test/txtfiles/code_highlight_6_2_2_trunc.txt new file mode 100644 index 000000000..2d3e2e404 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2_2_trunc.txt @@ -0,0 +1,2 @@ + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2_3.txt b/test/txtfiles/code_highlight_6_2_3.txt new file mode 100644 index 000000000..2d3e2e404 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2_3.txt @@ -0,0 +1,2 @@ + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_2_3_trunc.txt b/test/txtfiles/code_highlight_6_2_3_trunc.txt new file mode 100644 index 000000000..2d3e2e404 --- /dev/null +++ b/test/txtfiles/code_highlight_6_2_3_trunc.txt @@ -0,0 +1,2 @@ + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3.txt b/test/txtfiles/code_highlight_6_3.txt new file mode 100644 index 000000000..365b97bc8 --- /dev/null +++ b/test/txtfiles/code_highlight_6_3.txt @@ -0,0 +1,4 @@ + {grey39}91{/grey39}  @test is_background(hex) + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor + {grey39}93{/grey39}  end +{red bold}❯{/red bold} {white}94{/white} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3_1.txt b/test/txtfiles/code_highlight_6_3_1.txt new file mode 100644 index 000000000..af651cb13 --- /dev/null +++ b/test/txtfiles/code_highlight_6_3_1.txt @@ -0,0 +1,10 @@ + 91  + @test is_bac +kground(hex) + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3_1_trunc.txt b/test/txtfiles/code_highlight_6_3_1_trunc.txt new file mode 100644 index 000000000..8febed765 --- /dev/null +++ b/test/txtfiles/code_highlight_6_3_1_trunc.txt @@ -0,0 +1,4 @@ + 91 ... + 92 ... + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3_2.txt b/test/txtfiles/code_highlight_6_3_2.txt new file mode 100644 index 000000000..3559afbb9 --- /dev/null +++ b/test/txtfiles/code_highlight_6_3_2.txt @@ -0,0 +1,6 @@ + 91  @test is_background( +hex) + 92  @test get_color(hex; + bg = true) isa RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3_2_trunc.txt b/test/txtfiles/code_highlight_6_3_2_trunc.txt new file mode 100644 index 000000000..357f786d7 --- /dev/null +++ b/test/txtfiles/code_highlight_6_3_2_trunc.txt @@ -0,0 +1,4 @@ + 91  @test is_backgrou... + 92  @test get_color(h... + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3_3.txt b/test/txtfiles/code_highlight_6_3_3.txt new file mode 100644 index 000000000..13f461bbb --- /dev/null +++ b/test/txtfiles/code_highlight_6_3_3.txt @@ -0,0 +1,4 @@ + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_3_3_trunc.txt b/test/txtfiles/code_highlight_6_3_3_trunc.txt new file mode 100644 index 000000000..13f461bbb --- /dev/null +++ b/test/txtfiles/code_highlight_6_3_3_trunc.txt @@ -0,0 +1,4 @@ + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4.txt b/test/txtfiles/code_highlight_6_4.txt new file mode 100644 index 000000000..0ef6e57af --- /dev/null +++ b/test/txtfiles/code_highlight_6_4.txt @@ -0,0 +1,6 @@ + {grey39}89{/grey39}  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#123123"] + {grey39}90{/grey39}  for hex in hexes + {grey39}91{/grey39}  @test is_background(hex) + {grey39}92{/grey39}  @test get_color(hex; bg = true) isa RGBColor + {grey39}93{/grey39}  end +{red bold}❯{/red bold} {white}94{/white} end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4_1.txt b/test/txtfiles/code_highlight_6_4_1.txt new file mode 100644 index 000000000..9aae1861a --- /dev/null +++ b/test/txtfiles/code_highlight_6_4_1.txt @@ -0,0 +1,17 @@ + 89  hexes += ["on_#ffffff" +, "on_#000000", + "on_#dada2a", +"on_#123123"] + 90  for +hex in hexes + 91  + @test is_bac +kground(hex) + 92  + @test get_co +lor(hex; bg += true) isa +RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4_1_trunc.txt b/test/txtfiles/code_highlight_6_4_1_trunc.txt new file mode 100644 index 000000000..b58ad453b --- /dev/null +++ b/test/txtfiles/code_highlight_6_4_1_trunc.txt @@ -0,0 +1,6 @@ + 89 ... + 90 ... + 91 ... + 92 ... + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4_2.txt b/test/txtfiles/code_highlight_6_4_2.txt new file mode 100644 index 000000000..054a4077e --- /dev/null +++ b/test/txtfiles/code_highlight_6_4_2.txt @@ -0,0 +1,10 @@ + 89  hexes = ["on_#ffffff", +"on_#000000", "on_#dada2a", +"on_#123123"] + 90  for hex in hexes + 91  @test is_background( +hex) + 92  @test get_color(hex; + bg = true) isa RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4_2_trunc.txt b/test/txtfiles/code_highlight_6_4_2_trunc.txt new file mode 100644 index 000000000..1cc97d68e --- /dev/null +++ b/test/txtfiles/code_highlight_6_4_2_trunc.txt @@ -0,0 +1,6 @@ + 89  hexes = ["on_#ffffff"... + 90  for hex in hexes + 91  @test is_backgrou... + 92  @test get_color(h... + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4_3.txt b/test/txtfiles/code_highlight_6_4_3.txt new file mode 100644 index 000000000..5a23547e5 --- /dev/null +++ b/test/txtfiles/code_highlight_6_4_3.txt @@ -0,0 +1,7 @@ + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a", "on_#12 +3123"] + 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/code_highlight_6_4_3_trunc.txt b/test/txtfiles/code_highlight_6_4_3_trunc.txt new file mode 100644 index 000000000..16899970c --- /dev/null +++ b/test/txtfiles/code_highlight_6_4_3_trunc.txt @@ -0,0 +1,6 @@ + 89  hexes = ["on_#ffffff", "on_#000000", "on_#dada2a",... + 90  for hex in hexes + 91  @test is_background(hex) + 92  @test get_color(hex; bg = true) isa RGBColor + 93  end +❯ 94 end \ No newline at end of file diff --git a/test/txtfiles/compositor_2.txt b/test/txtfiles/compositor_2.txt index b52ae7612..96ed9c9c9 100644 --- a/test/txtfiles/compositor_2.txt +++ b/test/txtfiles/compositor_2.txt @@ -1,17 +1,17 @@ -╲ ╲ ╲ ╲ ╲ ╲ ╭──────────╮ - ╲ ╲ ╲ ╲ ╲ ╲│ │ -╲ ╲ ╲ ╲ ╲ ╲ │ │ - ╲ ╲ ╲ ╲ ╲ ╲│ │ -╲ ╲ ╲ ╲ ╲ ╲ │ │ - ╲ ╲ ╲ ╲ ╲ ╲│ │ -╲ ╲ ╲ ╲ ╲ ╲ │ │ - ╲ ╲ ╲ ╲ ╲ ╲│ │ -╲ ╲ ╲ ╲ ╲ ╲ │ │ - ╲ ╲ ╲ ╲ ╲ ╲│ │ -╲ ╲ ╲ ╲ ╲ ╲ │ │ - ╲ ╲ ╲ ╲ ╲ ╲│ │ -╲ ╲ ╲ ╲ ╲ ╲ │ │ - ╲ ╲ ╲ ╲ ╲ ╲╰──────────╯ +╲ ╲ ╲ ╲ ╲ ╲ ╭──────────╮ + ╲ ╲ ╲ ╲ ╲ ╲│ │ +╲ ╲ ╲ ╲ ╲ ╲ │ │ + ╲ ╲ ╲ ╲ ╲ ╲│ │ +╲ ╲ ╲ ╲ ╲ ╲ │ │ + ╲ ╲ ╲ ╲ ╲ ╲│ │ +╲ ╲ ╲ ╲ ╲ ╲ │ │ + ╲ ╲ ╲ ╲ ╲ ╲│ │ +╲ ╲ ╲ ╲ ╲ ╲ │ │ + ╲ ╲ ╲ ╲ ╲ ╲│ │ +╲ ╲ ╲ ╲ ╲ ╲ │ │ + ╲ ╲ ╲ ╲ ╲ ╲│ │ +╲ ╲ ╲ ╲ ╲ ╲ │ │ + ╲ ╲ ╲ ╲ ╲ ╲╰──────────╯ ╲ ╲ ╲ ╲ ╲ ╲   ╲ ╲ ╲ ╲ ╲ ╲ ╲ ╲ ╲ ╲ ╲ ╲  diff --git a/test/txtfiles/compositor_4.txt b/test/txtfiles/compositor_4.txt index 7982abeab..07f89c5d2 100644 --- a/test/txtfiles/compositor_4.txt +++ b/test/txtfiles/compositor_4.txt @@ -1,33 +1,33 @@ -╭──────────────────╮ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -╰──────────────────╯ +╭──────────────────╮ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +╰──────────────────╯ -╭──────────╮ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -│ │ -╰──────────╯ +╭──────────╮ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +╰──────────╯ ╲ ╲ ╲ ╲ ╲ ╲  diff --git a/test/txtfiles/dendo_expr_1.txt b/test/txtfiles/dendo_expr_1.txt index 6b3ed0b9c..f82882106 100644 --- a/test/txtfiles/dendo_expr_1.txt +++ b/test/txtfiles/dendo_expr_1.txt @@ -3,6 +3,6 @@  2x  3y  2   ⋀  ⋀   ┴  ┴  - call: * call: * + call: * call: *  ┌──────┴─────┐  ┌──────┴─────┐   2 x  3 y  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_2.txt b/test/txtfiles/dendo_expr_2.txt index 030b73020..9c45675f2 100644 --- a/test/txtfiles/dendo_expr_2.txt +++ b/test/txtfiles/dendo_expr_2.txt @@ -3,6 +3,6 @@  2x  3  2  2y   ⋀   ⋀   ┴   ┴  - call: * call: * + call: * call: *  ┌──────┴─────┐   ┌──────┴─────┐   2 x   2 y  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_3.txt b/test/txtfiles/dendo_expr_3.txt index 971c463c1..094c2e281 100644 --- a/test/txtfiles/dendo_expr_3.txt +++ b/test/txtfiles/dendo_expr_3.txt @@ -8,6 +8,6 @@  x  3+y   ⋀   ┴  - call: + + call: +  ┌──────┴─────┐   3 y  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_4.txt b/test/txtfiles/dendo_expr_4.txt index 777e43a60..107af473d 100644 --- a/test/txtfiles/dendo_expr_4.txt +++ b/test/txtfiles/dendo_expr_4.txt @@ -3,11 +3,11 @@  1+1  2*x^2   ⋀  ⋀   ┴  ┴  - call: + call: * + call: + call: *  ┌──────┴─────┐  ┌─────────┴────────┐   1 1  2  x^2   ⋀   ┴  - call: ^ + call: ^  ┌──────┴─────┐   x 2  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_5.txt b/test/txtfiles/dendo_expr_5.txt index 16187ca50..e0512a1c1 100644 --- a/test/txtfiles/dendo_expr_5.txt +++ b/test/txtfiles/dendo_expr_5.txt @@ -1,6 +1,6 @@  mod(22,6)   ⋀   ┴  - call: mod + call: mod  ┌──────┴─────┐   22 6  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_6.txt b/test/txtfiles/dendo_expr_6.txt index 21499b82b..e644119cf 100644 --- a/test/txtfiles/dendo_expr_6.txt +++ b/test/txtfiles/dendo_expr_6.txt @@ -3,7 +3,7 @@  2*x^(3+y)  2z   ⋀  ⋀   ┴  ┴  - call: * call: * + call: * call: *  ┌──────────┴──────────┐  ┌──────┴─────┐   2  x^(3+y)  2 z   ⋀  @@ -13,6 +13,6 @@  x  3+y   ⋀   ┴  - call: + + call: +  ┌──────┴─────┐   3 y  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_7.txt b/test/txtfiles/dendo_expr_7.txt index f78c01610..6a3b0c1e4 100644 --- a/test/txtfiles/dendo_expr_7.txt +++ b/test/txtfiles/dendo_expr_7.txt @@ -3,7 +3,7 @@  2x  3*√(3*x^2)   ⋀  ⋀   ┴  ┴  - call: * call: * + call: * call: *  ┌──────┴─────┐  ┌───────────┴──────────┐   2 x  3  √(3*x^2)   ⋀  @@ -18,6 +18,6 @@  3  x^2   ⋀   ┴  - call: ^ + call: ^  ┌──────┴─────┐   x 2  \ No newline at end of file diff --git a/test/txtfiles/dendo_expr_8.txt b/test/txtfiles/dendo_expr_8.txt index 3ab2800ea..3b28f6e6a 100644 --- a/test/txtfiles/dendo_expr_8.txt +++ b/test/txtfiles/dendo_expr_8.txt @@ -1,8 +1,8 @@ call: print  ┌──────┴─────┐  - print  lstrip(... + print  lstrip(...  ⋀   ┴  - call: lstrip + call: lstrip  ┴   test  \ No newline at end of file diff --git a/test/txtfiles/exptree_expr_1.txt b/test/txtfiles/exptree_expr_1.txt index 7eccf92dc..a3045356a 100644 --- a/test/txtfiles/exptree_expr_1.txt +++ b/test/txtfiles/exptree_expr_1.txt @@ -1,15 +1,17 @@ + ╭─────────────────────────────────── 2x+3y+2 ──────────────────────────────────╮ │ │ -│ 2x+3y+2 │ -│ ━━━━━━━━━ │ -│ │  │ -│ └── 2x+3y+2 (call: +) │ -│  ├── 2x (call: *) │ -│  │ ├── 2 │ -│  │ └── x │ -│  ├── 3y (call: *) │ -│  │ ├── 3 │ -│  │ └── y │ -│  └── 2 │ +│ 2x + 3y + 2 │ +│ ├─ 1 ⇒ + │ +│ ├─ 2 ⇒ 2x │ +│ │ ├─ 1 ⇒ * │ +│ │ ├─ 2 ⇒ 2 │ +│ │ └─ 3 ⇒ x │ +│ ├─ 3 ⇒ 3y │ +│ │ ├─ 1 ⇒ * │ +│ │ ├─ 2 ⇒ 3 │ +│ │ └─ 3 ⇒ y │ +│ └─ 4 ⇒ 2 │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_2.txt b/test/txtfiles/exptree_expr_2.txt index 95ae21807..a74d21d50 100644 --- a/test/txtfiles/exptree_expr_2.txt +++ b/test/txtfiles/exptree_expr_2.txt @@ -1,16 +1,17 @@ ╭────────────────────────────────── 2x+3+2+2y ─────────────────────────────────╮ │ │ -│ 2x+3+2+2y │ -│ ━━━━━━━━━━━ │ -│ │  │ -│ └── 2x+3+2+2y (call: +) │ -│  ├── 2x (call: *) │ -│  │ ├── 2 │ -│  │ └── x │ -│  ├── 3 │ -│  ├── 2 │ -│  └── 2y (call: *) │ -│   ├── 2 │ -│   └── y │ +│ 2x + 3 + 2 + 2y │ +│ ├─ 1 ⇒ + │ +│ ├─ 2 ⇒ 2x │ +│ │ ├─ 1 ⇒ * │ +│ │ ├─ 2 ⇒ 2 │ +│ │ └─ 3 ⇒ x │ +│ ├─ 3 ⇒ 3 │ +│ ├─ 4 ⇒ 2 │ +│ └─ 5 ⇒ 2y │ +│ ├─ 1 ⇒ * │ +│ ├─ 2 ⇒ 2 │ +│ └─ 3 ⇒ y │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_3.txt b/test/txtfiles/exptree_expr_3.txt index 09181c250..5eec4e5dd 100644 --- a/test/txtfiles/exptree_expr_3.txt +++ b/test/txtfiles/exptree_expr_3.txt @@ -1,14 +1,15 @@ ╭────────────────────────────────── 2*x^(3+y) ─────────────────────────────────╮ │ │ -│ 2*x^(3+y) │ -│ ━━━━━━━━━━━ │ -│ │  │ -│ └── 2*x^(3+y) (call: *) │ -│  ├── 2 │ -│  └── x^(3+y) (call: ^) │ -│   ├── x │ -│   └── 3+y (call: +) │ -│    ├── 3 │ -│    └── y │ +│ 2 * x ^ (3 + y) │ +│ ├─ 1 ⇒ * │ +│ ├─ 2 ⇒ 2 │ +│ └─ 3 ⇒ x ^ (3 + y) │ +│ ├─ 1 ⇒ ^ │ +│ ├─ 2 ⇒ x │ +│ └─ 3 ⇒ 3 + y │ +│ ├─ 1 ⇒ + │ +│ ├─ 2 ⇒ 3 │ +│ └─ 3 ⇒ y │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_4.txt b/test/txtfiles/exptree_expr_4.txt index ebae023f1..c524b6888 100644 --- a/test/txtfiles/exptree_expr_4.txt +++ b/test/txtfiles/exptree_expr_4.txt @@ -1,16 +1,19 @@ + ╭───────────────────────────────── (1+1)-2*x^2 ────────────────────────────────╮ │ │ -│ (1+1)-2*x^2 │ -│ ━━━━━━━━━━━━━ │ -│ │  │ -│ └── (1+1)-2*x^2 (call: -) │ -│  ├── 1+1 (call: +) │ -│  │ ├── 1 │ -│  │ └── 1 │ -│  └── 2*x^2 (call: *) │ -│   ├── 2 │ -│   └── x^2 (call: ^) │ -│    ├── x │ -│    └── 2 │ +│ (1 + 1) - 2 * x ^ 2 │ +│ ├─ 1 ⇒ - │ +│ ├─ 2 ⇒ 1 + 1 │ +│ │ ├─ 1 ⇒ + │ +│ │ ├─ 2 ⇒ 1 │ +│ │ └─ 3 ⇒ 1 │ +│ └─ 3 ⇒ 2 * x ^ 2 │ +│ ├─ 1 ⇒ * │ +│ ├─ 2 ⇒ 2 │ +│ └─ 3 ⇒ x ^ 2 │ +│ ├─ 1 ⇒ ^ │ +│ ├─ 2 ⇒ x │ +│ └─ 3 ⇒ 2 │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_5.txt b/test/txtfiles/exptree_expr_5.txt index f3b46e2de..89fd9876b 100644 --- a/test/txtfiles/exptree_expr_5.txt +++ b/test/txtfiles/exptree_expr_5.txt @@ -1,10 +1,10 @@ + ╭────────────────────────────────── mod(22,6) ─────────────────────────────────╮ │ │ -│ mod(22,6) │ -│ ━━━━━━━━━━━ │ -│ │  │ -│ └── mod(22,6) (call: mod) │ -│  ├── 22 │ -│  └── 6 │ +│ mod(22, 6) │ +│ ├─ 1 ⇒ mod │ +│ ├─ 2 ⇒ 22 │ +│ └─ 3 ⇒ 6 │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_6.txt b/test/txtfiles/exptree_expr_6.txt index 508d19959..d7df81585 100644 --- a/test/txtfiles/exptree_expr_6.txt +++ b/test/txtfiles/exptree_expr_6.txt @@ -1,18 +1,22 @@ + ╭──────────────────────────────── 2*x^(3+y)+2z ────────────────────────────────╮ │ │ -│ 2*x^(3+y)+2z │ -│ ━━━━━━━━━━━━━━ │ -│ │  │ -│ └── 2*x^(3+y)+2z (call: +) │ -│  ├── 2*x^(3+y) (call: *) │ -│  │ ├── 2 │ -│  │ └── x^(3+y) (call: ^) │ -│  │  ├── x │ -│  │  └── 3+y (call: +) │ -│  │   ├── 3 │ -│  │   └── y │ -│  └── 2z (call: *) │ -│   ├── 2 │ -│   └── z │ +│ 2 * x ^ (3 + y) + 2z │ +│ ├─ 1 ⇒ + │ +│ ├─ 2 ⇒ 2 * x ^ (3 + y) │ +│ │ ├─ 1 ⇒ * │ +│ │ ├─ 2 ⇒ 2 │ +│ │ └─ 3 ⇒ x ^ (3 + y) │ +│ │ ├─ 1 ⇒ ^ │ +│ │ ├─ 2 ⇒ x │ +│ │ └─ 3 ⇒ 3 + y │ +│ │ ├─ 1 ⇒ + │ +│ │ ├─ 2 ⇒ 3 │ +│ │ └─ 3 ⇒ y │ +│ └─ 3 ⇒ 2z │ +│ ├─ 1 ⇒ * │ +│ ├─ 2 ⇒ 2 │ +│ └─ 3 ⇒ z │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_7.txt b/test/txtfiles/exptree_expr_7.txt index 64a594af3..ae3d7f033 100644 --- a/test/txtfiles/exptree_expr_7.txt +++ b/test/txtfiles/exptree_expr_7.txt @@ -1,19 +1,24 @@ + ╭──────────────────────────────── 2x+3*√(3*x^2) ───────────────────────────────╮ │ │ -│ 2x+3*√(3*x^2) │ -│ ━━━━━━━━━━━━━━━ │ -│ │  │ -│ └── 2x+3*√(3*x^2) (call: +) │ -│  ├── 2x (call: *) │ -│  │ ├── 2 │ -│  │ └── x │ -│  └── 3*√(3*x^2) (call: *) │ -│   ├── 3 │ -│   └── √(3*x^2) (call: √) │ -│    └── 3*x^2 (call: *) │ -│     ├── 3 │ -│     └── x^2 (call: ^) │ -│      ├── x │ -│      └── 2 │ +│ 2x + 3 * √(3 * x ^ 2) │ +│ ├─ 1 ⇒ + │ +│ ├─ 2 ⇒ 2x │ +│ │ ├─ 1 ⇒ * │ +│ │ ├─ 2 ⇒ 2 │ +│ │ └─ 3 ⇒ x │ +│ └─ 3 ⇒ 3 * √(3 * x ^ 2) │ +│ ├─ 1 ⇒ * │ +│ ├─ 2 ⇒ 3 │ +│ └─ 3 ⇒ √(3 * x ^ 2) │ +│ ├─ 1 ⇒ √ │ +│ └─ 2 ⇒ 3 * x ^ 2 │ +│ ├─ 1 ⇒ * │ +│ ├─ 2 ⇒ 3 │ +│ └─ 3 ⇒ x ^ 2 │ +│ ├─ 1 ⇒ ^ │ +│ ├─ 2 ⇒ x │ +│ └─ 3 ⇒ 2 │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/exptree_expr_8.txt b/test/txtfiles/exptree_expr_8.txt index 933d9c0af..c81d53f8d 100644 --- a/test/txtfiles/exptree_expr_8.txt +++ b/test/txtfiles/exptree_expr_8.txt @@ -1,10 +1,11 @@ + ╭──────────────────────────── print(lstrip("test")) ───────────────────────────╮ │ │ -│ print(lstrip("test")) │ -│ ━━━━━━━━━━━━━━━━━━━━━━━ │ -│ │  │ -│ └── print(lstrip("test")) (call: print) │ -│  └── lstrip("test") (call: lstrip) │ -│   └── test │ +│ print(lstrip("test")) │ +│ ├─ 1 ⇒ print │ +│ └─ 2 ⇒ lstrip("test") │ +│ ├─ 1 ⇒ lstrip │ +│ └─ 2 ⇒ test │ │ │ -╰────────────────────────────────────────────────────────────────── inspect ───╯ +│ │ +╰────────────────────────────────────────────────────────────────── inspect ───╯ diff --git a/test/txtfiles/fill_in_1.txt b/test/txtfiles/fill_in_1.txt new file mode 100644 index 000000000..64f030e07 --- /dev/null +++ b/test/txtfiles/fill_in_1.txt @@ -0,0 +1,5 @@ +adsda +adasda +ergeer +xcvxvxvx +aasdada \ No newline at end of file diff --git a/test/txtfiles/fill_in_2.txt b/test/txtfiles/fill_in_2.txt new file mode 100644 index 000000000..a1acbd999 --- /dev/null +++ b/test/txtfiles/fill_in_2.txt @@ -0,0 +1,5 @@ +adsda {red}{/red} +adasda {red}{/red} +ergeer {red}{/red} +xcvxvxvx{red}{/red} +aasdada {red}{/red} \ No newline at end of file diff --git a/test/txtfiles/inspect_panel.txt b/test/txtfiles/inspect_panel.txt deleted file mode 100644 index e0220049f..000000000 --- a/test/txtfiles/inspect_panel.txt +++ /dev/null @@ -1,136 +0,0 @@ -─────────────────────────────── inspecting: Panel ────────────────────────────── -○ Types hierarchy: - AbstractRenderable - ━━━━━━━━━━━━━━━━━━━━ - │  - ├── Renderable - ├── Term.Progress.AbstractColumn - ├── Term.Panels.AbstractPanel - │ └── Panel - ├── Term.Layout.AbstractLayoutElement - ├── Tree - ├── RenderableText - ├── Table - ├── Term.Dendograms.Leaf - └── Dendogram - -○ Panel constructors: - ────── Methods in Term.Panels for Panel ────── - (1) Panel(; fit, height, width, padding, kwargs...) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:101 - - (2) Panel(content::Union{AbstractString, AbstractRenderable}; fit, padding, width, kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:155 - - - (3) Panel(content::Union{AbstractString, AbstractRenderable}, ::Val{false}, -padding::Padding; height, width, background, justify, -kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:278 - - (4) Panel(content::Union{AbstractString, AbstractRenderable}, ::Val{true}, -padding::Padding; height, width, background, justify, -kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:224 - - (5) Panel(texts::Vector{AbstractString}; kwargs...) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:339 - - (6) Panel(renderables::Vector{Union{AbstractString, AbstractRenderable}; kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:336 - - (7) Panel(x1, x2; kwargs...) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:61 - - (8) Panel(ren, renderables...; kwargs...) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:341 - - -○ Methods for Panel: - ────── Methods in Term.Panels for Panel ────── - (1) size(p::Panel) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:72 - - -○ Methods for AbstractRenderable: - ────── Methods in Term.Layout for AbstractRenderable ────── - (1) *(r1::AbstractString, r2::AbstractRenderable) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/layout.jl:510 - - (2) *(r1::AbstractRenderable, r2::AbstractString) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/layout.jl:511 - - (3) *(r1::AbstractRenderable, r2::AbstractRenderable) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/layout.jl:509 - - (4) /(r1::Union{AbstractString, AbstractRenderable}, r2::Union{AbstractString, AbstractRenderable}) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/layout.jl:505 - - - ────── Methods in Term.Renderables for AbstractRenderable ────── - (5) print(io::IO, renderable::AbstractRenderable; highlight) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/renderables.jl:64 - - (6) show(io::IO, renderable::AbstractRenderable) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/renderables.jl:74 - - (7) show(io::IO, ::MIME{Symbol("text/plain")}, -renderable::AbstractRenderable) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/renderables.jl:81 - - (8) string(r::AbstractRenderable) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/renderables.jl:43 - - (9) string(renderable::AbstractRenderable, width::Int64) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/renderables.jl:49 - - ────── Methods in Term.Panels for AbstractRenderable -────── - (10) Panel(content::Union{AbstractString, AbstractRenderable}; fit, padding, width, kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:155 - - - (11) Panel(content::Union{AbstractString, AbstractRenderable}, ::Val{false}, -padding::Padding; height, width, background, justify, -kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:278 - - (12) Panel(content::Union{AbstractString, AbstractRenderable}, ::Val{true}, -padding::Padding; height, width, background, justify, -kwargs...) - → -/Users/federicoclaudi/Documents/Github/Term.jl/src/panels.jl:224 - - ────── Methods in Term.Layout for AbstractRenderable ────── - (13) hLine(ren::AbstractRenderable; kwargs...) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/layout.jl:678 - - ────── Methods in Term.Tprint for AbstractRenderable ────── - (14) tprint(io::IO, x::AbstractRenderable; highlight) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/tprint.jl:54 - - ────── Methods in Term.Compositors for AbstractRenderable -────── - (15) update!(compositor::Compositor, id::Symbol, content::Union{String, AbstractRenderable}) - -→ - -/Users/federicoclaudi/Documents/Github/Term.jl/src/compositors.jl:126 - - - ────── Methods in Term.Layout for AbstractRenderable ────── - (16) vLine(ren::AbstractRenderable; kwargs...) - → /Users/federicoclaudi/Documents/Github/Term.jl/src/layout.jl:599 - diff --git a/test/txtfiles/introspection_panel.txt b/test/txtfiles/introspection_panel.txt deleted file mode 100644 index 5c15d8dfe..000000000 --- a/test/txtfiles/introspection_panel.txt +++ /dev/null @@ -1,57 +0,0 @@ -─────────────────────────────── inspecting: MyStr ────────────────────────────── - ╭─────────────────────────────────────────────────────────────────────────╮ - │ │ - │ MyStr <: Structy │ - │ │x ::Int64 │ - │ │y ::Vector │ - │ │ - ╰─────────────────────────────────────────────────────────────────────────╯ -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -No documentation found. - -┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Summary ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ - - ┌──────────────────────────────────────────────────────────────────┐ - │ struct MyStr │ - └──────────────────────────────────────────────────────────────────┘ - -┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Fields ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ - - ┌──────────────────────────────────────────────────────────────────┐ - │ x :: Int64 │ - │ y :: Vector │ - └──────────────────────────────────────────────────────────────────┘ - -┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Supertype Hierarchy ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ - - ┌──────────────────────────────────────────────────────────────────┐ - │ MyStr <: Structy <: Any │ - └──────────────────────────────────────────────────────────────────┘ - - -○ Types hierarchy: - Structy - ━━━━━━━━━ - │ - └── MyStr - -○ MyStr constructors: - ────── Methods in Main for MyStr ────── - (1) MyStr(x::Int64, y::Vector) - → -/Users/federicoclaudi/Documents/Github/Term.jl/test/10_test_inspect.jl:53 - - (2) MyStr(x) - → -/Users/federicoclaudi/Documents/Github/Term.jl/test/10_test_inspect.jl:56 - - (3) MyStr(x, y) - → -/Users/federicoclaudi/Documents/Github/Term.jl/test/10_test_inspect.jl:53 - diff --git a/test/txtfiles/introspection_print.txt b/test/txtfiles/introspection_print.txt deleted file mode 100644 index 7b01f081e..000000000 --- a/test/txtfiles/introspection_print.txt +++ /dev/null @@ -1,56 +0,0 @@ -─────────────────────────────── inspecting: print ────────────────────────────── - ╭──── Function: print ─────────────────────────────────────────────────╮ - │ │ - │ (1) print(io::IO, ex::Union) │ - │ (2) print(io::IO, s::Union) │ - │ (3) print(io::IO, x::Union) │ - │ (4) print(io::IO, t::Text{<:Function}) │ - │ (5) print(io::IO, t::Text) │ - │ (6) print(io::IO, x::Dates.Period) │ - │ (7) print(io::IO, n::Unsigned) │ - │ (8) print(io::IO, ::MIME) where mime │ - │ (9) print(io::IO, │ - │ renderable::Term.Renderables.AbstractRenderable; highlight) │ - │ (10) print(io::IO, str::ProgressLogging.ProgressString) │ - │ │ - ╰─────────────────────────────────────────────────────── 36 methods ───╯ -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - ┌─────────────────────────────────────────────────────────┐ - │ print([io::IO], xs...) │ - └─────────────────────────────────────────────────────────┘ - - Write to `io` (or to the default output stream `stdout` (@ref) if `io` - is not given) a canonical (un-decorated) text representation. The - representation used by `print` includes minimal formatting and tries - to avoid Julia-specific details. - - `print` falls back to calling `show`, so most types should just define - `show`. Define `print` if your type has a separate "plain" - representation. For example, `show` displays strings with quotes, and - `print` displays strings without quotes. - - See also `println` (@ref), `string` (@ref), `printstyled` (@ref). - - ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ Examples ┃ - ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ - - ┌─────────────────────────────────────────────────────────┐ - │ julia> print("Hello World!") │ - │ Hello World! │ - │ julia> io = IOBuffer(); │ - │ │ - │ julia> print(io, "Hello", ' ', :World!) │ - │ │ - │ julia> String(take!(io)) │ - │ "Hello World!" │ - └─────────────────────────────────────────── jldoctest ───┘ - - ┌─────────────────────────────────────────────────────────┐ - │ print(io::IO, renderable::AbstractRenderable) │ - └─────────────────────────────────────────────────────────┘ - - Print a renderable to an IO - - - diff --git a/test/txtfiles/link_pad_1_1.txt b/test/txtfiles/link_pad_1_1.txt new file mode 100644 index 000000000..5e574fac7 --- /dev/null +++ b/test/txtfiles/link_pad_1_1.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ diff --git a/test/txtfiles/link_pad_1_2.txt b/test/txtfiles/link_pad_1_2.txt new file mode 100644 index 000000000..5e574fac7 --- /dev/null +++ b/test/txtfiles/link_pad_1_2.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ diff --git a/test/txtfiles/link_pad_1_3.txt b/test/txtfiles/link_pad_1_3.txt new file mode 100644 index 000000000..5e574fac7 --- /dev/null +++ b/test/txtfiles/link_pad_1_3.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ diff --git a/test/txtfiles/link_pad_2_1.txt b/test/txtfiles/link_pad_2_1.txt new file mode 100644 index 000000000..fc9e6fc68 --- /dev/null +++ b/test/txtfiles/link_pad_2_1.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ diff --git a/test/txtfiles/link_pad_2_2.txt b/test/txtfiles/link_pad_2_2.txt new file mode 100644 index 000000000..fc9e6fc68 --- /dev/null +++ b/test/txtfiles/link_pad_2_2.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ diff --git a/test/txtfiles/link_pad_2_3.txt b/test/txtfiles/link_pad_2_3.txt new file mode 100644 index 000000000..fc9e6fc68 --- /dev/null +++ b/test/txtfiles/link_pad_2_3.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ diff --git a/test/txtfiles/link_pad_3_1.txt b/test/txtfiles/link_pad_3_1.txt new file mode 100644 index 000000000..e2f989106 --- /dev/null +++ b/test/txtfiles/link_pad_3_1.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ diff --git a/test/txtfiles/link_pad_3_2.txt b/test/txtfiles/link_pad_3_2.txt new file mode 100644 index 000000000..e2f989106 --- /dev/null +++ b/test/txtfiles/link_pad_3_2.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ diff --git a/test/txtfiles/link_pad_3_3.txt b/test/txtfiles/link_pad_3_3.txt new file mode 100644 index 000000000..e2f989106 --- /dev/null +++ b/test/txtfiles/link_pad_3_3.txt @@ -0,0 +1 @@ + ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ diff --git a/test/txtfiles/link_panel_1_1_1.txt b/test/txtfiles/link_panel_1_1_1.txt new file mode 100644 index 000000000..5d8d4568b --- /dev/null +++ b/test/txtfiles/link_panel_1_1_1.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +╰─────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_1_2.txt b/test/txtfiles/link_panel_1_1_2.txt new file mode 100644 index 000000000..83581faad --- /dev/null +++ b/test/txtfiles/link_panel_1_1_2.txt @@ -0,0 +1,4 @@ +╭─────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +│ abcd │ +╰─────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_1_3.txt b/test/txtfiles/link_panel_1_1_3.txt new file mode 100644 index 000000000..7273b73a8 --- /dev/null +++ b/test/txtfiles/link_panel_1_1_3.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\abcd │ +╰─────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_1_4.txt b/test/txtfiles/link_panel_1_1_4.txt new file mode 100644 index 000000000..8b73ae572 --- /dev/null +++ b/test/txtfiles/link_panel_1_1_4.txt @@ -0,0 +1,3 @@ +╭────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +╰────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_1_5.txt b/test/txtfiles/link_panel_1_1_5.txt new file mode 100644 index 000000000..952079ec0 --- /dev/null +++ b/test/txtfiles/link_panel_1_1_5.txt @@ -0,0 +1,6 @@ +╭──────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +│ ╭────────────────────────────────────────────────╮ │ +│ │ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ │ +│ ╰────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_2_1.txt b/test/txtfiles/link_panel_1_2_1.txt new file mode 100644 index 000000000..54ffcbd7a --- /dev/null +++ b/test/txtfiles/link_panel_1_2_1.txt @@ -0,0 +1,3 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl ]8;;\ │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_2_2.txt b/test/txtfiles/link_panel_1_2_2.txt new file mode 100644 index 000000000..69804995b --- /dev/null +++ b/test/txtfiles/link_panel_1_2_2.txt @@ -0,0 +1,4 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +│ abcd │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_2_3.txt b/test/txtfiles/link_panel_1_2_3.txt new file mode 100644 index 000000000..09fc9f8f0 --- /dev/null +++ b/test/txtfiles/link_panel_1_2_3.txt @@ -0,0 +1,3 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\abcd │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_2_4.txt b/test/txtfiles/link_panel_1_2_4.txt new file mode 100644 index 000000000..8b73ae572 --- /dev/null +++ b/test/txtfiles/link_panel_1_2_4.txt @@ -0,0 +1,3 @@ +╭────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +╰────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_1_2_5.txt b/test/txtfiles/link_panel_1_2_5.txt new file mode 100644 index 000000000..4c8561368 --- /dev/null +++ b/test/txtfiles/link_panel_1_2_5.txt @@ -0,0 +1,6 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ +│ ╭────────────────────────────────────────────────╮ │ +│ │ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl\...Term.jl/src/_tables.jl]8;;\ │ │ +│ ╰────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_1_1.txt b/test/txtfiles/link_panel_2_1_1.txt new file mode 100644 index 000000000..028e1683b --- /dev/null +++ b/test/txtfiles/link_panel_2_1_1.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +╰─────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_1_2.txt b/test/txtfiles/link_panel_2_1_2.txt new file mode 100644 index 000000000..b63b93b07 --- /dev/null +++ b/test/txtfiles/link_panel_2_1_2.txt @@ -0,0 +1,4 @@ +╭─────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ abcd │ +╰─────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_1_3.txt b/test/txtfiles/link_panel_2_1_3.txt new file mode 100644 index 000000000..b6b3785de --- /dev/null +++ b/test/txtfiles/link_panel_2_1_3.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\abcd │ +╰─────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_1_4.txt b/test/txtfiles/link_panel_2_1_4.txt new file mode 100644 index 000000000..0fc0cc462 --- /dev/null +++ b/test/txtfiles/link_panel_2_1_4.txt @@ -0,0 +1,3 @@ +╭────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +╰────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_1_5.txt b/test/txtfiles/link_panel_2_1_5.txt new file mode 100644 index 000000000..0f23f3d6f --- /dev/null +++ b/test/txtfiles/link_panel_2_1_5.txt @@ -0,0 +1,6 @@ +╭──────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ ╭────────────────────────────────────────────────╮ │ +│ │ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ │ +│ ╰────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_2_1.txt b/test/txtfiles/link_panel_2_2_1.txt new file mode 100644 index 000000000..ec5f960d2 --- /dev/null +++ b/test/txtfiles/link_panel_2_2_1.txt @@ -0,0 +1,3 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234 ]8;;\ │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_2_2.txt b/test/txtfiles/link_panel_2_2_2.txt new file mode 100644 index 000000000..8acee6bc0 --- /dev/null +++ b/test/txtfiles/link_panel_2_2_2.txt @@ -0,0 +1,4 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ abcd │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_2_3.txt b/test/txtfiles/link_panel_2_2_3.txt new file mode 100644 index 000000000..d7b845526 --- /dev/null +++ b/test/txtfiles/link_panel_2_2_3.txt @@ -0,0 +1,3 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\abcd │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_2_4.txt b/test/txtfiles/link_panel_2_2_4.txt new file mode 100644 index 000000000..0fc0cc462 --- /dev/null +++ b/test/txtfiles/link_panel_2_2_4.txt @@ -0,0 +1,3 @@ +╭────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +╰────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_2_2_5.txt b/test/txtfiles/link_panel_2_2_5.txt new file mode 100644 index 000000000..2d6fc5cd9 --- /dev/null +++ b/test/txtfiles/link_panel_2_2_5.txt @@ -0,0 +1,6 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ ╭────────────────────────────────────────────────╮ │ +│ │ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ │ +│ ╰────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_1_1.txt b/test/txtfiles/link_panel_3_1_1.txt new file mode 100644 index 000000000..00d39cf4b --- /dev/null +++ b/test/txtfiles/link_panel_3_1_1.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +╰─────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_1_2.txt b/test/txtfiles/link_panel_3_1_2.txt new file mode 100644 index 000000000..cc3250f63 --- /dev/null +++ b/test/txtfiles/link_panel_3_1_2.txt @@ -0,0 +1,4 @@ +╭─────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ abcd │ +╰─────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_1_3.txt b/test/txtfiles/link_panel_3_1_3.txt new file mode 100644 index 000000000..07a5c6289 --- /dev/null +++ b/test/txtfiles/link_panel_3_1_3.txt @@ -0,0 +1,3 @@ +╭─────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\abcd │ +╰─────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_1_4.txt b/test/txtfiles/link_panel_3_1_4.txt new file mode 100644 index 000000000..35ba9093c --- /dev/null +++ b/test/txtfiles/link_panel_3_1_4.txt @@ -0,0 +1,3 @@ +╭────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +╰────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_1_5.txt b/test/txtfiles/link_panel_3_1_5.txt new file mode 100644 index 000000000..ebaf0da5c --- /dev/null +++ b/test/txtfiles/link_panel_3_1_5.txt @@ -0,0 +1,6 @@ +╭──────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ ╭────────────────────────────────────────────────╮ │ +│ │ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ │ +│ ╰────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_2_1.txt b/test/txtfiles/link_panel_3_2_1.txt new file mode 100644 index 000000000..15d556534 --- /dev/null +++ b/test/txtfiles/link_panel_3_2_1.txt @@ -0,0 +1,3 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234 ]8;;\ │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_2_2.txt b/test/txtfiles/link_panel_3_2_2.txt new file mode 100644 index 000000000..503665b0a --- /dev/null +++ b/test/txtfiles/link_panel_3_2_2.txt @@ -0,0 +1,4 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ abcd │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_2_3.txt b/test/txtfiles/link_panel_3_2_3.txt new file mode 100644 index 000000000..d4d2c07bd --- /dev/null +++ b/test/txtfiles/link_panel_3_2_3.txt @@ -0,0 +1,3 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\abcd │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_2_4.txt b/test/txtfiles/link_panel_3_2_4.txt new file mode 100644 index 000000000..35ba9093c --- /dev/null +++ b/test/txtfiles/link_panel_3_2_4.txt @@ -0,0 +1,3 @@ +╭────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +╰────────────────────────────────────────────────╯ diff --git a/test/txtfiles/link_panel_3_2_5.txt b/test/txtfiles/link_panel_3_2_5.txt new file mode 100644 index 000000000..d6c64be16 --- /dev/null +++ b/test/txtfiles/link_panel_3_2_5.txt @@ -0,0 +1,6 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ +│ ╭────────────────────────────────────────────────╮ │ +│ │ ]8;;/Users/federicoclaudi/Documents/Github/Term.jl/src/_tables.jl#234\...Term.jl/src/_tables.jl 234]8;;\ │ │ +│ ╰────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ diff --git a/test/txtfiles/markdown_2.txt b/test/txtfiles/markdown_2.txt index bc974be79..78ac30592 100644 --- a/test/txtfiles/markdown_2.txt +++ b/test/txtfiles/markdown_2.txt @@ -1,6 +1,6 @@ -┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ -┃ Markdown rendering in Term.jl ┃ -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Markdown rendering in Term.jl ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ {bold #42A5F5 underline}twp{/bold #42A5F5 underline} diff --git a/test/txtfiles/markdown_3.txt b/test/txtfiles/markdown_3.txt index 3ad94f34e..9b4f1e557 100644 --- a/test/txtfiles/markdown_3.txt +++ b/test/txtfiles/markdown_3.txt @@ -1,54 +1,54 @@ -This is an example of markdown content rendered in Term.jl. -You can use markdown syntax to make words {bold}bold{/bold} and {italic}italic{/italic} -or insert {#FFF59D italic}`{/#FFF59D italic}literals{#FFF59D italic}`{/#FFF59D italic}. +This is an example of markdown content rendered in Term.jl. +You can use markdown syntax to make words {bold}bold{/bold} and {italic}italic{/italic} +or insert {#FFF59D italic}`{/#FFF59D italic}literals{#FFF59D italic}`{/#FFF59D italic}. -You markdown can include in-line latex {#FFF59D italic}ŁaTeX frac{{1}}{{2}}{/#FFF59D italic} and -maths in a new line too: +You markdown can include in-line latex {#FFF59D italic}ŁaTeX frac{{1}}{{2}}{/#FFF59D italic} and +maths in a new line too: - {#FFF59D italic}f(a) = \frac{1}{2\pi}\int_{0}^{2\pi} (\alpha+R\cos(\theta))d\theta{/#FFF59D italic} + {#FFF59D italic}f(a) = \frac{1}{2\pi}\int_{0}^{2\pi} (\alpha+R\cos(\theta))d\theta{/#FFF59D italic}{/0}{/1}  -You can also have links: {white bold}Julia{/white bold} {dim}(http://www.julialang.org){/dim} -and footnotes {#9aacdb}[1]{/#9aacdb} for your content {#9aacdb}[named]{/#9aacdb}. +You can also have links: {white bold}Julia{/white bold} {dim}(http://www.julialang.org){/dim} +and footnotes {#9aacdb}[1]{/#9aacdb} for your content {#9aacdb}[named]{/#9aacdb}. And, of course, you can show some code too: - ┌──────────────────────────────────────────────┐ - │ function say_hi(x)  │ - │  print("Hellow World")  │ - │ end  │ - └──────────────────────────────────── julia ───┘ + ┌──────────────────────────────────────────────┐ + │ function say_hi(x)  │ + │  print("Hellow World")  │ + │ end  │ + └──────────────────────────────────── julia ───┘ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ You can use "quotes" to highlight a section: - > “Multi-line quotes can be helpful to make a paragram - ┃ stand out, so that users - ┃ won't miss it! You can use other inline syntax in - ┃ you `quotes` too.” + > “Multi-line quotes can be helpful to make a paragram + ┃ stand out, so that users + ┃ won't miss it! You can use other inline syntax in + ┃ you `quotes` too.” -but if you really need to grab someone's attention, use -admonitions: +but if you really need to grab someone's attention, use +admonitions: - ╭──── Note ────────────────────────────────────────╮ - │ You can use different levels │ - ╰──────────────────────────────────────────────────╯ + ╭──── Note ────────────────────────────────────────╮ + │ You can use different levels │ + ╰──────────────────────────────────────────────────╯ - ╭──── Warning ─────────────────────────────────────╮ - │ to send different messages │ - ╰──────────────────────────────────────────────────╯ + ╭──── Warning ─────────────────────────────────────╮ + │ to send different messages │ + ╰──────────────────────────────────────────────────╯ - ╭──── Danger ──────────────────────────────────────╮ - │ to your reader │ - ╰──────────────────────────────────────────────────╯ + ╭──── Danger ──────────────────────────────────────╮ + │ to your reader │ + ╰──────────────────────────────────────────────────╯ - ╭──── Wow! ────────────────────────────────────────╮ - │ Turns out that admonitions can be pretty │ - │ useful! │ - │ What will you use them for? │ - ╰──────────────────────────────────────────────────╯ + ╭──── Wow! ────────────────────────────────────────╮ + │ Turns out that admonitions can be pretty │ + │ useful! │ + │ What will you use them for? │ + ╰──────────────────────────────────────────────────╯ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -69,20 +69,20 @@ and ordered lists too: {bold} 3. {/bold}item three - ╭──── Tables ──────────────────────────────────────╮ - │ You can use the Markdown table syntax (https: │ - │ //www │ - │ .markdownguide.org/extended-sy │ - │ ntax/#tables) to insert tables - Term.jl will │ - │ convert them to Table object! │ - ╰──────────────────────────────────────────────────╯ + ╭──── Tables ──────────────────────────────────────╮ + │ You can use the Markdown table syntax (https: │ + │ //www │ + │ .markdownguide.org/extended-sy │ + │ ntax/#tables) to insert tables - Term.jl will │ + │ convert them to Table object! │ + ╰──────────────────────────────────────────────────╯ ╭───────────┬──────────────┬────────────╮ │ Term │ handles │ tables │ ├───────────┼──────────────┼────────────┤ - │ Row `1` │ Column `2` │ │ + │ Row `1` │ Column `2` │ │ ├───────────┼──────────────┼────────────┤ - │ Row 2 │ Row 2 │ Column 3 │ + │ Row 2 │ Row 2 │ Column 3 │ ╰───────────┴──────────────┴────────────╯ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -91,5 +91,5 @@ This is where you print the content of your foot notes: [1]: Numbered footnote text. -[note]: Named footnote text containing several toplevel -elements. \ No newline at end of file +[note]: Named footnote text containing several toplevel +elements. \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_1_1.txt b/test/txtfiles/nested_tags_reshape_1_1.txt new file mode 100644 index 000000000..65d55af23 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_1_1.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_1_1_reverse.txt b/test/txtfiles/nested_tags_reshape_1_1_reverse.txt new file mode 100644 index 000000000..65d55af23 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_1_1_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_1_2.txt b/test/txtfiles/nested_tags_reshape_1_2.txt new file mode 100644 index 000000000..65d55af23 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_1_2.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_1_2_reverse.txt b/test/txtfiles/nested_tags_reshape_1_2_reverse.txt new file mode 100644 index 000000000..65d55af23 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_1_2_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_1_3.txt b/test/txtfiles/nested_tags_reshape_1_3.txt new file mode 100644 index 000000000..65d55af23 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_1_3.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_1_3_reverse.txt b/test/txtfiles/nested_tags_reshape_1_3_reverse.txt new file mode 100644 index 000000000..65d55af23 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_1_3_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_2_1.txt b/test/txtfiles/nested_tags_reshape_2_1.txt new file mode 100644 index 000000000..a04a4847d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_2_1.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_2_1_reverse.txt b/test/txtfiles/nested_tags_reshape_2_1_reverse.txt new file mode 100644 index 000000000..a04a4847d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_2_1_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_2_2.txt b/test/txtfiles/nested_tags_reshape_2_2.txt new file mode 100644 index 000000000..a04a4847d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_2_2.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_2_2_reverse.txt b/test/txtfiles/nested_tags_reshape_2_2_reverse.txt new file mode 100644 index 000000000..a04a4847d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_2_2_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_2_3.txt b/test/txtfiles/nested_tags_reshape_2_3.txt new file mode 100644 index 000000000..a04a4847d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_2_3.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_2_3_reverse.txt b/test/txtfiles/nested_tags_reshape_2_3_reverse.txt new file mode 100644 index 000000000..a04a4847d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_2_3_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa dad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_3_1.txt b/test/txtfiles/nested_tags_reshape_3_1.txt new file mode 100644 index 000000000..fbd17b63d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_3_1.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_3_1_reverse.txt b/test/txtfiles/nested_tags_reshape_3_1_reverse.txt new file mode 100644 index 000000000..fbd17b63d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_3_1_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_3_2.txt b/test/txtfiles/nested_tags_reshape_3_2.txt new file mode 100644 index 000000000..fbd17b63d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_3_2.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_3_2_reverse.txt b/test/txtfiles/nested_tags_reshape_3_2_reverse.txt new file mode 100644 index 000000000..fbd17b63d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_3_2_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_3_3.txt b/test/txtfiles/nested_tags_reshape_3_3.txt new file mode 100644 index 000000000..fbd17b63d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_3_3.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_3_3_reverse.txt b/test/txtfiles/nested_tags_reshape_3_3_reverse.txt new file mode 100644 index 000000000..fbd17b63d --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_3_3_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_4_1.txt b/test/txtfiles/nested_tags_reshape_4_1.txt new file mode 100644 index 000000000..a2f371297 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_4_1.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_4_1_reverse.txt b/test/txtfiles/nested_tags_reshape_4_1_reverse.txt new file mode 100644 index 000000000..a2f371297 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_4_1_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_4_2.txt b/test/txtfiles/nested_tags_reshape_4_2.txt new file mode 100644 index 000000000..a2f371297 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_4_2.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_4_2_reverse.txt b/test/txtfiles/nested_tags_reshape_4_2_reverse.txt new file mode 100644 index 000000000..a2f371297 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_4_2_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_4_3.txt b/test/txtfiles/nested_tags_reshape_4_3.txt new file mode 100644 index 000000000..a2f371297 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_4_3.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_4_3_reverse.txt b/test/txtfiles/nested_tags_reshape_4_3_reverse.txt new file mode 100644 index 000000000..a2f371297 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_4_3_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad  +asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_5_1.txt b/test/txtfiles/nested_tags_reshape_5_1.txt new file mode 100644 index 000000000..b5231b231 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_5_1.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad asad + asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_5_1_reverse.txt b/test/txtfiles/nested_tags_reshape_5_1_reverse.txt new file mode 100644 index 000000000..b5231b231 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_5_1_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad asad + asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_5_2.txt b/test/txtfiles/nested_tags_reshape_5_2.txt new file mode 100644 index 000000000..b5231b231 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_5_2.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad asad + asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_5_2_reverse.txt b/test/txtfiles/nested_tags_reshape_5_2_reverse.txt new file mode 100644 index 000000000..b5231b231 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_5_2_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad asad + asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_5_3.txt b/test/txtfiles/nested_tags_reshape_5_3.txt new file mode 100644 index 000000000..b5231b231 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_5_3.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad asad + asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_5_3_reverse.txt b/test/txtfiles/nested_tags_reshape_5_3_reverse.txt new file mode 100644 index 000000000..b5231b231 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_5_3_reverse.txt @@ -0,0 +1,3 @@ +adasd ad sa dsa ad  +sd d ads ad da dad asad + asdsa ddfsf ad a  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_6_1.txt b/test/txtfiles/nested_tags_reshape_6_1.txt new file mode 100644 index 000000000..d5d8b1a63 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_6_1.txt @@ -0,0 +1,7 @@ + pink pink bold  pink +bold blue  pink bold + pink  pink on blue + just on blue  NOW SIMPLE + WHITE  red red red + white white  underline +underline  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_6_1_reverse.txt b/test/txtfiles/nested_tags_reshape_6_1_reverse.txt new file mode 100644 index 000000000..d5d8b1a63 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_6_1_reverse.txt @@ -0,0 +1,7 @@ + pink pink bold  pink +bold blue  pink bold + pink  pink on blue + just on blue  NOW SIMPLE + WHITE  red red red + white white  underline +underline  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_6_2.txt b/test/txtfiles/nested_tags_reshape_6_2.txt new file mode 100644 index 000000000..d5d8b1a63 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_6_2.txt @@ -0,0 +1,7 @@ + pink pink bold  pink +bold blue  pink bold + pink  pink on blue + just on blue  NOW SIMPLE + WHITE  red red red + white white  underline +underline  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_6_2_reverse.txt b/test/txtfiles/nested_tags_reshape_6_2_reverse.txt new file mode 100644 index 000000000..d5d8b1a63 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_6_2_reverse.txt @@ -0,0 +1,7 @@ + pink pink bold  pink +bold blue  pink bold + pink  pink on blue + just on blue  NOW SIMPLE + WHITE  red red red + white white  underline +underline  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_6_3.txt b/test/txtfiles/nested_tags_reshape_6_3.txt new file mode 100644 index 000000000..d5d8b1a63 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_6_3.txt @@ -0,0 +1,7 @@ + pink pink bold  pink +bold blue  pink bold + pink  pink on blue + just on blue  NOW SIMPLE + WHITE  red red red + white white  underline +underline  \ No newline at end of file diff --git a/test/txtfiles/nested_tags_reshape_6_3_reverse.txt b/test/txtfiles/nested_tags_reshape_6_3_reverse.txt new file mode 100644 index 000000000..d5d8b1a63 --- /dev/null +++ b/test/txtfiles/nested_tags_reshape_6_3_reverse.txt @@ -0,0 +1,7 @@ + pink pink bold  pink +bold blue  pink bold + pink  pink on blue + just on blue  NOW SIMPLE + WHITE  red red red + white white  underline +underline  \ No newline at end of file diff --git a/test/txtfiles/panels_constructors_1.txt b/test/txtfiles/panels_constructors_1.txt new file mode 100644 index 000000000..144a96535 --- /dev/null +++ b/test/txtfiles/panels_constructors_1.txt @@ -0,0 +1,8 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭───╮ │ +│ │ │ │ +│ ╰───╯ │ +│ ╭──────╮ │ +│ │ │ │ +│ ╰──────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_constructors_2.txt b/test/txtfiles/panels_constructors_2.txt new file mode 100644 index 000000000..144a96535 --- /dev/null +++ b/test/txtfiles/panels_constructors_2.txt @@ -0,0 +1,8 @@ +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭───╮ │ +│ │ │ │ +│ ╰───╯ │ +│ ╭──────╮ │ +│ │ │ │ +│ ╰──────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_layout_macro.txt b/test/txtfiles/panels_layout_macro.txt index 558d21389..a3c679943 100644 --- a/test/txtfiles/panels_layout_macro.txt +++ b/test/txtfiles/panels_layout_macro.txt @@ -1,20 +1,20 @@ -╭──────────────────────────────────────────────────────────────────────────────╮ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ inner │ │ -│ │ ╭──────────────────────────────────────────────────────────────────╮ │ │ -│ │ │ out │ │ │ -│ │ │ ╭────────────────────────────────────────────────────────────╮ │ │ │ -│ │ │ │ deep │ │ │ │ -│ │ │ ╰────────────────────────────────────────────────────────────╯ │ │ │ -│ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 │ │ -│ │ inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 │ │ -│ │ inner2 inner2 inner2 inner2 inner2 inner2 inner2 │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ test │ -│ adasdasda │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│  ... content omitted ...  │ -╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ inner │ │ +│ │ ╭──────────────────────────────────────────────────────────────────╮ │ │ +│ │ │ out │ │ │ +│ │ │ ╭────────────────────────────────────────────────────────────╮ │ │ │ +│ │ │ │ deep │ │ │ │ +│ │ │ ╰────────────────────────────────────────────────────────────╯ │ │ │ +│ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 │ │ +│ │ inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 inner2 │ │ +│ │ inner2 inner2 inner2 inner2 inner2 inner2 inner2 │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ test │ +│ adasdasda │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│  ... content omitted ...  │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_layout_macro2.txt b/test/txtfiles/panels_layout_macro2.txt index 921c0f1cb..ca8d029e9 100644 --- a/test/txtfiles/panels_layout_macro2.txt +++ b/test/txtfiles/panels_layout_macro2.txt @@ -1,20 +1,20 @@ -╭──────────────────────────────────────────────────────────────────────────────╮ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ ╭──────────────────────────────────────────────────────────────────╮ │ │ -│ │ │ │ │ │ -│ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ ╭──────────────────────────────────────────────────────────────────╮ │ │ -│ │ │ red │ │ │ -│ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ done │ -│ │ -╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ ╭──────────────────────────────────────────────────────────────────╮ │ │ +│ │ │ │ │ │ +│ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ ╭──────────────────────────────────────────────────────────────────╮ │ │ +│ │ │ red │ │ │ +│ │ ╰──────────────────────────────────────────────────────────────────╯ │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ done │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_layout_macro3.txt b/test/txtfiles/panels_layout_macro3.txt index 137e3007c..273952ab7 100644 --- a/test/txtfiles/panels_layout_macro3.txt +++ b/test/txtfiles/panels_layout_macro3.txt @@ -1,3 +1,3 @@ -╭──────────────────────────────────────────────────────────────────────────────╮ -│ │ -╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file +╭──────────────────────────────────────────────────────────────────────────────╮ +│ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_layout_macro4.txt b/test/txtfiles/panels_layout_macro4.txt index fd86fcee9..2763250bc 100644 --- a/test/txtfiles/panels_layout_macro4.txt +++ b/test/txtfiles/panels_layout_macro4.txt @@ -1,5 +1,5 @@ -╭──────────────────────────────────────────────────────────────────────────────╮ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_layout_macro5.txt b/test/txtfiles/panels_layout_macro5.txt index 091712985..d9e2ab4e0 100644 --- a/test/txtfiles/panels_layout_macro5.txt +++ b/test/txtfiles/panels_layout_macro5.txt @@ -1,8 +1,8 @@ -╭──────────────────────────────────────────────────────────────────────────────╮ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ a │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ b │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ a │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ b │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/panels_layout_macro6.txt b/test/txtfiles/panels_layout_macro6.txt index 1ad0512bc..6388f9736 100644 --- a/test/txtfiles/panels_layout_macro6.txt +++ b/test/txtfiles/panels_layout_macro6.txt @@ -1,8 +1,8 @@ -╭──────────────────────────────────────────────────────────────────────────────╮ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ a │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -│ ╭────────────────────────────────────────────────────────────────────────╮ │ -│ │ b │ │ -│ ╰────────────────────────────────────────────────────────────────────────╯ │ -╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ a │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +│ ╭────────────────────────────────────────────────────────────────────────╮ │ +│ │ b │ │ +│ ╰────────────────────────────────────────────────────────────────────────╯ │ +╰──────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/prompt_print_1.txt b/test/txtfiles/prompt_print_1.txt new file mode 100644 index 000000000..ae7a1fdbd --- /dev/null +++ b/test/txtfiles/prompt_print_1.txt @@ -0,0 +1,2 @@ +❯❯❯ basic prompt? + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_1_ln.txt b/test/txtfiles/prompt_print_1_ln.txt new file mode 100644 index 000000000..3099ba19c --- /dev/null +++ b/test/txtfiles/prompt_print_1_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ basic prompt? + diff --git a/test/txtfiles/prompt_print_1_t.txt b/test/txtfiles/prompt_print_1_t.txt new file mode 100644 index 000000000..965c2881b --- /dev/null +++ b/test/txtfiles/prompt_print_1_t.txt @@ -0,0 +1,3 @@ +❯❯❯ basic prompt? + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_1_tln.txt b/test/txtfiles/prompt_print_1_tln.txt new file mode 100644 index 000000000..965c2881b --- /dev/null +++ b/test/txtfiles/prompt_print_1_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ basic prompt? + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_2.txt b/test/txtfiles/prompt_print_2.txt new file mode 100644 index 000000000..9b1088759 --- /dev/null +++ b/test/txtfiles/prompt_print_2.txt @@ -0,0 +1,2 @@ +❯❯❯ basic prompt? + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_2_ln.txt b/test/txtfiles/prompt_print_2_ln.txt new file mode 100644 index 000000000..b30cc5922 --- /dev/null +++ b/test/txtfiles/prompt_print_2_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ basic prompt? + diff --git a/test/txtfiles/prompt_print_2_t.txt b/test/txtfiles/prompt_print_2_t.txt new file mode 100644 index 000000000..2954cf64d --- /dev/null +++ b/test/txtfiles/prompt_print_2_t.txt @@ -0,0 +1,3 @@ +❯❯❯ basic prompt? + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_2_tln.txt b/test/txtfiles/prompt_print_2_tln.txt new file mode 100644 index 000000000..2954cf64d --- /dev/null +++ b/test/txtfiles/prompt_print_2_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ basic prompt? + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_3.txt b/test/txtfiles/prompt_print_3.txt new file mode 100644 index 000000000..4d88a0004 --- /dev/null +++ b/test/txtfiles/prompt_print_3.txt @@ -0,0 +1,2 @@ +❯❯❯ Gimme a number + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_3_ln.txt b/test/txtfiles/prompt_print_3_ln.txt new file mode 100644 index 000000000..544a44577 --- /dev/null +++ b/test/txtfiles/prompt_print_3_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ Gimme a number + diff --git a/test/txtfiles/prompt_print_3_t.txt b/test/txtfiles/prompt_print_3_t.txt new file mode 100644 index 000000000..62f781ffd --- /dev/null +++ b/test/txtfiles/prompt_print_3_t.txt @@ -0,0 +1,3 @@ +❯❯❯ Gimme a number + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_3_tln.txt b/test/txtfiles/prompt_print_3_tln.txt new file mode 100644 index 000000000..62f781ffd --- /dev/null +++ b/test/txtfiles/prompt_print_3_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ Gimme a number + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_4.txt b/test/txtfiles/prompt_print_4.txt new file mode 100644 index 000000000..63dd33693 --- /dev/null +++ b/test/txtfiles/prompt_print_4.txt @@ -0,0 +1,2 @@ +❯❯❯ Gimme a number + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_4_ln.txt b/test/txtfiles/prompt_print_4_ln.txt new file mode 100644 index 000000000..0eb8e0226 --- /dev/null +++ b/test/txtfiles/prompt_print_4_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ Gimme a number + diff --git a/test/txtfiles/prompt_print_4_t.txt b/test/txtfiles/prompt_print_4_t.txt new file mode 100644 index 000000000..146849aa6 --- /dev/null +++ b/test/txtfiles/prompt_print_4_t.txt @@ -0,0 +1,3 @@ +❯❯❯ Gimme a number + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_4_tln.txt b/test/txtfiles/prompt_print_4_tln.txt new file mode 100644 index 000000000..146849aa6 --- /dev/null +++ b/test/txtfiles/prompt_print_4_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ Gimme a number + + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_5.txt b/test/txtfiles/prompt_print_5.txt new file mode 100644 index 000000000..222b8b346 --- /dev/null +++ b/test/txtfiles/prompt_print_5.txt @@ -0,0 +1,2 @@ +❯❯❯ What option? + one / two \ No newline at end of file diff --git a/test/txtfiles/prompt_print_5_ln.txt b/test/txtfiles/prompt_print_5_ln.txt new file mode 100644 index 000000000..703ee4582 --- /dev/null +++ b/test/txtfiles/prompt_print_5_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ What option? + one / two diff --git a/test/txtfiles/prompt_print_5_t.txt b/test/txtfiles/prompt_print_5_t.txt new file mode 100644 index 000000000..0eaaed5bb --- /dev/null +++ b/test/txtfiles/prompt_print_5_t.txt @@ -0,0 +1,3 @@ +❯❯❯ What option? + one / two + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_5_tln.txt b/test/txtfiles/prompt_print_5_tln.txt new file mode 100644 index 000000000..0eaaed5bb --- /dev/null +++ b/test/txtfiles/prompt_print_5_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ What option? + one / two + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_6.txt b/test/txtfiles/prompt_print_6.txt new file mode 100644 index 000000000..7356b5db8 --- /dev/null +++ b/test/txtfiles/prompt_print_6.txt @@ -0,0 +1,2 @@ +❯❯❯ What option? + one / two \ No newline at end of file diff --git a/test/txtfiles/prompt_print_6_ln.txt b/test/txtfiles/prompt_print_6_ln.txt new file mode 100644 index 000000000..01fe7526c --- /dev/null +++ b/test/txtfiles/prompt_print_6_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ What option? + one / two diff --git a/test/txtfiles/prompt_print_6_t.txt b/test/txtfiles/prompt_print_6_t.txt new file mode 100644 index 000000000..172624049 --- /dev/null +++ b/test/txtfiles/prompt_print_6_t.txt @@ -0,0 +1,3 @@ +❯❯❯ What option? + one / two + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_6_tln.txt b/test/txtfiles/prompt_print_6_tln.txt new file mode 100644 index 000000000..172624049 --- /dev/null +++ b/test/txtfiles/prompt_print_6_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ What option? + one / two + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_7.txt b/test/txtfiles/prompt_print_7.txt new file mode 100644 index 000000000..39d5a05d9 --- /dev/null +++ b/test/txtfiles/prompt_print_7.txt @@ -0,0 +1,2 @@ +❯❯❯ asking + yes, no \ No newline at end of file diff --git a/test/txtfiles/prompt_print_7_ln.txt b/test/txtfiles/prompt_print_7_ln.txt new file mode 100644 index 000000000..c34fab75e --- /dev/null +++ b/test/txtfiles/prompt_print_7_ln.txt @@ -0,0 +1,2 @@ +❯❯❯ asking + yes, no diff --git a/test/txtfiles/prompt_print_7_t.txt b/test/txtfiles/prompt_print_7_t.txt new file mode 100644 index 000000000..269365d91 --- /dev/null +++ b/test/txtfiles/prompt_print_7_t.txt @@ -0,0 +1,3 @@ +❯❯❯ asking + yes, no + \ No newline at end of file diff --git a/test/txtfiles/prompt_print_7_tln.txt b/test/txtfiles/prompt_print_7_tln.txt new file mode 100644 index 000000000..269365d91 --- /dev/null +++ b/test/txtfiles/prompt_print_7_tln.txt @@ -0,0 +1,3 @@ +❯❯❯ asking + yes, no + \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_1.txt b/test/txtfiles/rend_text_shape_1.txt new file mode 100644 index 000000000..703b1e519 --- /dev/null +++ b/test/txtfiles/rend_text_shape_1.txt @@ -0,0 +1,63 @@ +Lorem +ipsum +dolor +sit +amet, +consectet +ur adipis +cing +elit, +sed +do eiusmo +d tempor +incididun +t ut +labore +et dolore + magna +aliqua. +Ut enim +ad minim +veniam, +quis +nostrud +exercitat +ion +ullamco +laboris +nisi +ut aliqui +p ex +ea commod +o consequ +at. +Duis +aute +irure +dolor +in repreh +enderit +in volupt +ate +velit +esse +cillum +dolore +eu fugiat + nulla +pariatur. + Excepteu +r sint +occaecat +cupidatat + non +proident, + sunt +in culpa +qui +officia +deserunt +mollit +anim +id est +laborum. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_2.txt b/test/txtfiles/rend_text_shape_2.txt new file mode 100644 index 000000000..6c490abd9 --- /dev/null +++ b/test/txtfiles/rend_text_shape_2.txt @@ -0,0 +1,52 @@ +Lorem +ipsum +dolor +sit amet, +consectetur + adipiscing + elit, +sed do +eiusmod +tempor +incididunt +ut labore +et dolore +magna +aliqua. +Ut enim +ad minim +veniam, +quis nostru +d exercitat +ion ullamco + laboris +nisi ut +aliquip +ex ea +commodo +consequat. +Duis aute +irure +dolor +in reprehen +derit +in voluptat +e velit +esse cillum + dolore +eu fugiat +nulla +pariatur. +Excepteur +sint occaec +at cupidata +t non +proident, +sunt in +culpa +qui officia + deserunt +mollit +anim id +est laborum +. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_3.txt b/test/txtfiles/rend_text_shape_3.txt new file mode 100644 index 000000000..0ace1bc4b --- /dev/null +++ b/test/txtfiles/rend_text_shape_3.txt @@ -0,0 +1,37 @@ +Lorem ipsum +dolor sit +amet, consecte +tur adipiscing + elit, sed +do eiusmod +tempor incidid +unt ut labore +et dolore +magna aliqua. +Ut enim ad +minim veniam, +quis nostrud +exercitation +ullamco labori +s nisi ut +aliquip ex +ea commodo +consequat. +Duis aute +irure dolor +in reprehender +it in voluptat +e velit esse +cillum dolore +eu fugiat +nulla pariatur +. Excepteur +sint occaecat +cupidatat +non proident, +sunt in culpa +qui officia +deserunt +mollit anim +id est laborum +. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_4.txt b/test/txtfiles/rend_text_shape_4.txt new file mode 100644 index 000000000..d95a1025d --- /dev/null +++ b/test/txtfiles/rend_text_shape_4.txt @@ -0,0 +1,30 @@ +Lorem ipsum +dolor sit amet, +consectetur +adipiscing elit, +sed do eiusmod +tempor incididunt + ut labore et +dolore magna +aliqua. Ut enim +ad minim veniam, +quis nostrud +exercitation +ullamco laboris +nisi ut aliquip +ex ea commodo +consequat. Duis +aute irure dolor +in reprehenderit +in voluptate +velit esse cillum + dolore eu fugiat + nulla pariatur. +Excepteur sint +occaecat cupidata +t non proident, +sunt in culpa +qui officia +deserunt mollit +anim id est +laborum. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_5.txt b/test/txtfiles/rend_text_shape_5.txt new file mode 100644 index 000000000..380488eb6 --- /dev/null +++ b/test/txtfiles/rend_text_shape_5.txt @@ -0,0 +1,22 @@ +Lorem ipsum dolor +sit amet, consectetur +adipiscing elit, +sed do eiusmod tempor +incididunt ut labore +et dolore magna aliqua +. Ut enim ad minim +veniam, quis nostrud +exercitation ullamco +laboris nisi ut aliqui +p ex ea commodo conseq +uat. Duis aute irure +dolor in reprehenderit + in voluptate velit +esse cillum dolore +eu fugiat nulla pariat +ur. Excepteur sint +occaecat cupidatat +non proident, sunt +in culpa qui officia +deserunt mollit anim +id est laborum. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_6.txt b/test/txtfiles/rend_text_shape_6.txt new file mode 100644 index 000000000..f2a118a09 --- /dev/null +++ b/test/txtfiles/rend_text_shape_6.txt @@ -0,0 +1,20 @@ +Lorem ipsum dolor sit +amet, consectetur adipis +cing elit, sed do eiusmo +d tempor incididunt +ut labore et dolore +magna aliqua. Ut enim +ad minim veniam, quis +nostrud exercitation +ullamco laboris nisi +ut aliquip ex ea commodo + consequat. Duis aute +irure dolor in reprehend +erit in voluptate velit +esse cillum dolore +eu fugiat nulla pariatur +. Excepteur sint occaeca +t cupidatat non proident +, sunt in culpa qui +officia deserunt mollit +anim id est laborum. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_7.txt b/test/txtfiles/rend_text_shape_7.txt new file mode 100644 index 000000000..4a12bdaca --- /dev/null +++ b/test/txtfiles/rend_text_shape_7.txt @@ -0,0 +1,8 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit, +sed do eiusmod tempor incididunt ut labore et dolore magna +aliqua. Ut enim ad minim veniam, quis nostrud exercitation +ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit +esse cillum dolore eu fugiat nulla pariatur. Excepteur +sint occaecat cupidatat non proident, sunt in culpa qui +officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/test/txtfiles/rend_text_shape_i.txt b/test/txtfiles/rend_text_shape_i.txt new file mode 100644 index 000000000..832b0987d --- /dev/null +++ b/test/txtfiles/rend_text_shape_i.txt @@ -0,0 +1,8 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit, +sed do eiusmod tempor incididunt ut labore et dolore magna +aliqua. Ut enim ad minim veniam, quis nostrud exercitation +ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit +esse cillum dolore eu fugiat nulla pariatur. Excepteur +sint occaecat cupidatat non proident, sunt in culpa qui +officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/test/txtfiles/renderable_text_1.txt b/test/txtfiles/renderable_text_1.txt index cfb5957af..e75b36edc 100644 --- a/test/txtfiles/renderable_text_1.txt +++ b/test/txtfiles/renderable_text_1.txt @@ -1,4 +1,4 @@ - Lorem ipsum dolor sit amet, - consectetur adipiscing elit, - sed do eiusmod tempor incidid - unt ut labore \ No newline at end of file + Lorem ipsum dolor sit amet, + consectetur adipiscing elit, + sed do eiusmod tempor incidid + unt ut labore \ No newline at end of file diff --git a/test/txtfiles/renderable_text_2.txt b/test/txtfiles/renderable_text_2.txt index 152426c9a..39c5914ff 100644 --- a/test/txtfiles/renderable_text_2.txt +++ b/test/txtfiles/renderable_text_2.txt @@ -1,4 +1,4 @@ - Lorem ipsum dolor sit amet,  - consectetur adipiscing elit,  -sed do eiusmod tempor incidid  - unt ut labore  \ No newline at end of file + Lorem ipsum dolor sit amet,  + consectetur adipiscing elit,  +sed do eiusmod tempor incidid  + unt ut labore  \ No newline at end of file diff --git a/test/txtfiles/repr_T_struct.txt b/test/txtfiles/repr_T_struct.txt new file mode 100644 index 000000000..2c5f3f344 --- /dev/null +++ b/test/txtfiles/repr_T_struct.txt @@ -0,0 +1,3 @@ +╭──────────╮ +│ T()::T │ +╰──── T ───╯ diff --git a/test/txtfiles/repr_rocket.txt b/test/txtfiles/repr_rocket.txt new file mode 100644 index 000000000..745f453e4 --- /dev/null +++ b/test/txtfiles/repr_rocket.txt @@ -0,0 +1,6 @@ +╭────────────────────────────────╮ +│ width::Int64│ 10 │ +│ height::Int64│ 50 │ +│ mass::Float64│ 5000.0 │ +│ manufacturer::String│ NASA │ +╰───────────────────── Rocket ───╯ diff --git a/test/txtfiles/repr_rocket_2.txt b/test/txtfiles/repr_rocket_2.txt new file mode 100644 index 000000000..567d576fd --- /dev/null +++ b/test/txtfiles/repr_rocket_2.txt @@ -0,0 +1,6 @@ +╭─────────────────────────────╮ +│ width::Int64│ 1 │ +│ height::Int64│ 1 │ +│ mass::Float64│ 1.0 │ +│ manufacturer::String│ me │ +╰───────────────── Rocket2 ───╯ diff --git a/test/txtfiles/repr_rocket_2_show.txt b/test/txtfiles/repr_rocket_2_show.txt new file mode 100644 index 000000000..6a3e87486 --- /dev/null +++ b/test/txtfiles/repr_rocket_2_show.txt @@ -0,0 +1,11 @@ + ╭─────────────────────────────────────────────────────────────────────────╮ + │ │ + │ Rocket2 <: Any │ + │ │ width ::Int64 │ + │ │ height ::Int64 │ + │ │ mass ::Float64 │ + │ │manufacturer ::String │ + │ │ + ╰─────────────────────────────────────────────────────────────────────────╯ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +docs \ No newline at end of file diff --git a/test/txtfiles/repr_rocket_struct.txt b/test/txtfiles/repr_rocket_struct.txt new file mode 100644 index 000000000..e0d51f8eb --- /dev/null +++ b/test/txtfiles/repr_rocket_struct.txt @@ -0,0 +1,30 @@ + ╭─────────────────────────────────────────────────────────────────────────╮ + │ │ + │ Rocket <: Any │ + │ │ width ::Int64 │ + │ │ height ::Int64 │ + │ │ mass ::Float64 │ + │ │manufacturer ::String │ + │ │ + ╰─────────────────────────────────────────────────────────────────────────╯ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +No documentation found. + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Summary ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + ┌──────────────────────────────────────────────────────────────────┐ + │ struct Rocket  │ + └──────────────────────────────────────────────────────────────────┘ + +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Fields ┃ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + + ┌──────────────────────────────────────────────────────────────────┐ + │ width :: Int64  │ + │ height :: Int64  │ + │ mass :: Float64  │ + │ manufacturer :: String  │ + └──────────────────────────────────────────────────────────────────┘ \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_1_1.txt b/test/txtfiles/reshaped_code_1_1.txt new file mode 100644 index 000000000..9e42e4052 --- /dev/null +++ b/test/txtfiles/reshaped_code_1_1.txt @@ -0,0 +1,4 @@ +Table(data::Matrix{{Float64}}; +kwargs::Base.Pairs{Symbol, +Union{{}}, Tuple{{}}, NamedTuple +{(), Tuple{{}}}}) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_1_2.txt b/test/txtfiles/reshaped_code_1_2.txt new file mode 100644 index 000000000..d83fb1e2c --- /dev/null +++ b/test/txtfiles/reshaped_code_1_2.txt @@ -0,0 +1,2 @@ +Table(data::Matrix{{Float64}}; kwargs::Base.Pairs{Symbol, Union{{ +}}, Tuple{{}}, NamedTuple{(), Tuple{{}}}}) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_1_3.txt b/test/txtfiles/reshaped_code_1_3.txt new file mode 100644 index 000000000..afc233501 --- /dev/null +++ b/test/txtfiles/reshaped_code_1_3.txt @@ -0,0 +1,2 @@ +Table(data::Matrix{{Float64}}; kwargs::Base.Pairs{Symbol, Union{{}}, Tuple{{}}, NamedTup +le{(), Tuple{{}}}}) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_2_1.txt b/test/txtfiles/reshaped_code_2_1.txt new file mode 100644 index 000000000..e87357720 --- /dev/null +++ b/test/txtfiles/reshaped_code_2_1.txt @@ -0,0 +1,2 @@ +{{}}}, Tuple{{}}, NamedTuple{(), + Tuple{{}}}})Table \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_2_2.txt b/test/txtfiles/reshaped_code_2_2.txt new file mode 100644 index 000000000..11f280712 --- /dev/null +++ b/test/txtfiles/reshaped_code_2_2.txt @@ -0,0 +1 @@ +{{}}}, Tuple{{}}, NamedTuple{(), Tuple{{}}}})Table \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_2_3.txt b/test/txtfiles/reshaped_code_2_3.txt new file mode 100644 index 000000000..11f280712 --- /dev/null +++ b/test/txtfiles/reshaped_code_2_3.txt @@ -0,0 +1 @@ +{{}}}, Tuple{{}}, NamedTuple{(), Tuple{{}}}})Table \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_3_1.txt b/test/txtfiles/reshaped_code_3_1.txt new file mode 100644 index 000000000..a85d12fef --- /dev/null +++ b/test/txtfiles/reshaped_code_3_1.txt @@ -0,0 +1,12 @@ +Table(tb::Tables.MatrixTable{Mat +rix{{Float64}}}; box::Symbol, +style::String, hpad::Int64, +vpad::Int64, vertical_justify::S +ymbol, show_header::Bool, header +::Nothing, header_style::String, + header_justify::Nothing, column +s_style::String, columns_justify +::Symbol, columns_widths::Nothin +g, footer::Nothing, footer_style +::String, footer_justify::Symbol +, compact::Bool) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_3_2.txt b/test/txtfiles/reshaped_code_3_2.txt new file mode 100644 index 000000000..b2e90d6d8 --- /dev/null +++ b/test/txtfiles/reshaped_code_3_2.txt @@ -0,0 +1,6 @@ +Table(tb::Tables.MatrixTable{Matrix{{Float64}}}; box::Symbol, +style::String, hpad::Int64, vpad::Int64, vertical_justify::Symbol +, show_header::Bool, header::Nothing, header_style::String, +header_justify::Nothing, columns_style::String, columns_justify:: +Symbol, columns_widths::Nothing, footer::Nothing, footer_style::S +tring, footer_justify::Symbol, compact::Bool) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_3_3.txt b/test/txtfiles/reshaped_code_3_3.txt new file mode 100644 index 000000000..a8158002e --- /dev/null +++ b/test/txtfiles/reshaped_code_3_3.txt @@ -0,0 +1,5 @@ +Table(tb::Tables.MatrixTable{Matrix{{Float64}}}; box::Symbol, style::String, hpad::Int64 +, vpad::Int64, vertical_justify::Symbol, show_header::Bool, header::Nothing, header_styl +e::String, header_justify::Nothing, columns_style::String, columns_justify::Symbol, +columns_widths::Nothing, footer::Nothing, footer_style::String, footer_justify::Symbol, +compact::Bool) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_4_1.txt b/test/txtfiles/reshaped_code_4_1.txt new file mode 100644 index 000000000..8a5860a8e --- /dev/null +++ b/test/txtfiles/reshaped_code_4_1.txt @@ -0,0 +1,10 @@ +calc_columns_widths(N_cols::Int6 +4, N_rows::Int64, columns_widths +::Nothing, show_header::Bool, +header::Tuple{{String, String, +String}}, tb::Tables.MatrixTable +{Matrix{{Float64}}}, sch::Tables +.Schema{(:Column1, :Column2, +:Column3), Tuple{{Float64, +Float64, Float64}}}, footer::Not +hing, hpad::Vector{{Int64}}) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_4_2.txt b/test/txtfiles/reshaped_code_4_2.txt new file mode 100644 index 000000000..006a3497e --- /dev/null +++ b/test/txtfiles/reshaped_code_4_2.txt @@ -0,0 +1,5 @@ +calc_columns_widths(N_cols::Int64, N_rows::Int64, columns_widths: +:Nothing, show_header::Bool, header::Tuple{{String, String, +String}}, tb::Tables.MatrixTable{Matrix{{Float64}}}, sch::Tables. +Schema{(:Column1, :Column2, :Column3), Tuple{{Float64, Float64, +Float64}}}, footer::Nothing, hpad::Vector{{Int64}}) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_4_3.txt b/test/txtfiles/reshaped_code_4_3.txt new file mode 100644 index 000000000..e737c0fc0 --- /dev/null +++ b/test/txtfiles/reshaped_code_4_3.txt @@ -0,0 +1,4 @@ +calc_columns_widths(N_cols::Int64, N_rows::Int64, columns_widths::Nothing, show_header:: +Bool, header::Tuple{{String, String, String}}, tb::Tables.MatrixTable{Matrix{{Float64}}} +, sch::Tables.Schema{(:Column1, :Column2, :Column3), Tuple{{Float64, Float64, Float64}}} +, footer::Nothing, hpad::Vector{{Int64}}) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_5_1.txt b/test/txtfiles/reshaped_code_5_1.txt new file mode 100644 index 000000000..0dc525401 --- /dev/null +++ b/test/txtfiles/reshaped_code_5_1.txt @@ -0,0 +1,3 @@ +(::Term.Tables.var"#1#3"{Tables. +MatrixTable{Matrix{{Float64}}}}) +(c::Symbol) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_5_2.txt b/test/txtfiles/reshaped_code_5_2.txt new file mode 100644 index 000000000..c6196382c --- /dev/null +++ b/test/txtfiles/reshaped_code_5_2.txt @@ -0,0 +1,2 @@ +(::Term.Tables.var"#1#3"{Tables.MatrixTable{Matrix{{Float64}}}})( +c::Symbol) \ No newline at end of file diff --git a/test/txtfiles/reshaped_code_5_3.txt b/test/txtfiles/reshaped_code_5_3.txt new file mode 100644 index 000000000..057faefac --- /dev/null +++ b/test/txtfiles/reshaped_code_5_3.txt @@ -0,0 +1 @@ +(::Term.Tables.var"#1#3"{Tables.MatrixTable{Matrix{{Float64}}}})(c::Symbol) \ No newline at end of file diff --git a/test/txtfiles/reshaped_rend_with_markup_1.txt b/test/txtfiles/reshaped_rend_with_markup_1.txt new file mode 100644 index 000000000..2b2772594 --- /dev/null +++ b/test/txtfiles/reshaped_rend_with_markup_1.txt @@ -0,0 +1,7 @@ +╭────────────────────────────╮ +│ dasda asda dadasdaaadas │ +│ daddad asd ad ad ad │ +│ asdadadada ad as sad │ +│ ad adaad adas sd ads │ +│  │ +╰────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/reshaped_rend_with_markup_2.txt b/test/txtfiles/reshaped_rend_with_markup_2.txt new file mode 100644 index 000000000..2b2772594 --- /dev/null +++ b/test/txtfiles/reshaped_rend_with_markup_2.txt @@ -0,0 +1,7 @@ +╭────────────────────────────╮ +│ dasda asda dadasdaaadas │ +│ daddad asd ad ad ad │ +│ asdadadada ad as sad │ +│ ad adaad adas sd ads │ +│  │ +╰────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/reshaped_rend_with_markup_3.txt b/test/txtfiles/reshaped_rend_with_markup_3.txt new file mode 100644 index 000000000..9fe460c93 --- /dev/null +++ b/test/txtfiles/reshaped_rend_with_markup_3.txt @@ -0,0 +1,12 @@ +╭────────────────────────────╮ +│ dasda asda dadasdaaadas │ +│ daddad asd ad ad ad │ +│ asdadadada ad as sad │ +│ ad adaad adas sd ads │ +│  NOW SIMPLE  adasd │ +│ aads a asd ads a dasiud │ +│ h asjdnasdiuasda  │ +│ asdnaisudnadaiuda │ +│ sjduiabdiabd aduas │ +│  │ +╰────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/reshaped_rend_with_markup_4.txt b/test/txtfiles/reshaped_rend_with_markup_4.txt new file mode 100644 index 000000000..9fe460c93 --- /dev/null +++ b/test/txtfiles/reshaped_rend_with_markup_4.txt @@ -0,0 +1,12 @@ +╭────────────────────────────╮ +│ dasda asda dadasdaaadas │ +│ daddad asd ad ad ad │ +│ asdadadada ad as sad │ +│ ad adaad adas sd ads │ +│  NOW SIMPLE  adasd │ +│ aads a asd ads a dasiud │ +│ h asjdnasdiuasda  │ +│ asdnaisudnadaiuda │ +│ sjduiabdiabd aduas │ +│  │ +╰────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/reshaped_rend_with_markup_5.txt b/test/txtfiles/reshaped_rend_with_markup_5.txt new file mode 100644 index 000000000..751eb908f --- /dev/null +++ b/test/txtfiles/reshaped_rend_with_markup_5.txt @@ -0,0 +1,12 @@ +╭────────────────────────────╮ +│ dasda asda dadasdaaadas │ +│ daddad asd ad ad ad │ +│ asdadadada ad as sad │ +│ ad adaad adas sd ads │ +│  NOW SIMPLE  adasd │ +│ aads a asd ads a dasiud │ +│ h asjdnasdiuasda  │ +│ asdnaisudnadaiuda │ +│ sjduiabdiabd aduas │ +│  │ +╰────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/reshaped_rend_with_markup_6.txt b/test/txtfiles/reshaped_rend_with_markup_6.txt new file mode 100644 index 000000000..751eb908f --- /dev/null +++ b/test/txtfiles/reshaped_rend_with_markup_6.txt @@ -0,0 +1,12 @@ +╭────────────────────────────╮ +│ dasda asda dadasdaaadas │ +│ daddad asd ad ad ad │ +│ asdadadada ad as sad │ +│ ad adaad adas sd ads │ +│  NOW SIMPLE  adasd │ +│ aads a asd ads a dasiud │ +│ h asjdnasdiuasda  │ +│ asdnaisudnadaiuda │ +│ sjduiabdiabd aduas │ +│  │ +╰────────────────────────────╯ \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_1.txt b/test/txtfiles/reshaped_text_1.txt new file mode 100644 index 000000000..95b4477ac --- /dev/null +++ b/test/txtfiles/reshaped_text_1.txt @@ -0,0 +1,5 @@ +Lorem ipsum dolor sit amet, +consectetur adipiscing elit, +sed do eiusmod tempor incididunt +ut labore et dolore magna aliqua. + \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_10.txt b/test/txtfiles/reshaped_text_10.txt new file mode 100644 index 000000000..01c13ccc6 --- /dev/null +++ b/test/txtfiles/reshaped_text_10.txt @@ -0,0 +1,4 @@ +┌────────────abcde────┬────────── +── ────┬────────abcde fghi─────── +─┬────────────────┬────────────── + \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_11.txt b/test/txtfiles/reshaped_text_11.txt new file mode 100644 index 000000000..da30ce0d3 --- /dev/null +++ b/test/txtfiles/reshaped_text_11.txt @@ -0,0 +1,4 @@ +┌─────────{red}───ab{/red}cde────┬──────{green}────{/green} +{green}── ────┬────────abcde fghi{/green}─────── +─┬────────────────┬────────────── + \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_12.txt b/test/txtfiles/reshaped_text_12.txt new file mode 100644 index 000000000..beaf852b7 --- /dev/null +++ b/test/txtfiles/reshaped_text_12.txt @@ -0,0 +1,3 @@ +┌──────────{red}────{/red}──┬{blue bold}───────────────{/blue bold} +{blue bold}─┬──{/blue bold}──────────────┬────────────── +──┬──────────────end \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_13.txt b/test/txtfiles/reshaped_text_13.txt new file mode 100644 index 000000000..7b7212d7a --- /dev/null +++ b/test/txtfiles/reshaped_text_13.txt @@ -0,0 +1,4 @@ +................................. +................................. +................................. +. \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_14.txt b/test/txtfiles/reshaped_text_14.txt new file mode 100644 index 000000000..4762367ef --- /dev/null +++ b/test/txtfiles/reshaped_text_14.txt @@ -0,0 +1,3 @@ +.{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}..... +{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....{red}|||{/red}.....{red}|{/red} +{red}||{/red}.....{red}|||{/red}.... \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_15.txt b/test/txtfiles/reshaped_text_15.txt new file mode 100644 index 000000000..af1e3ae70 --- /dev/null +++ b/test/txtfiles/reshaped_text_15.txt @@ -0,0 +1,3 @@ +.|||.....|||.....|||.....|||..... +|||.....|||.....|||.....|||.....| +||.....|||.... \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_16.txt b/test/txtfiles/reshaped_text_16.txt new file mode 100644 index 000000000..d7a13229b --- /dev/null +++ b/test/txtfiles/reshaped_text_16.txt @@ -0,0 +1,18 @@ +Lorem ipsum {bold}dolor sit{/bold} amet, +consectetur adipiscing elit, +ed do e{red}iusmod tempor incididunt{/red} +ut {bold}labore et {underline}dolore{/underline} magna aliqua.{/bold} +{bold}{/bold} Ut enim ad minim +veniam, quis{green} nostrud exercitation{/green} +{green} {on_black}ullamco laboris nisi ut aliquip{/on_black}{/green} +{green}{on_black}ex {/on_black}{/green} +ea commodo consequat.{blue} Duis aute{/blue} +{blue}irure dolor in{/blue} reprehenderit + +in voluptate velit{/green} esse {italic}cillum{/italic} +{italic}dolore{/italic}{red} eu{/red}{italic green} fugiat {/italic green}nulla +pariatur. Excepteur{red} sint{/red}{blue} occaecat{/blue} +{blue} cupidatat {/blue}non proident, +sunt in culpa qui {italic}officia{/italic} deserun +t mollit anim +id est laborum. \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_17.txt b/test/txtfiles/reshaped_text_17.txt new file mode 100644 index 000000000..68c4a56e3 --- /dev/null +++ b/test/txtfiles/reshaped_text_17.txt @@ -0,0 +1,15 @@ +Term.jl is a {#9558B2}Julia{/#9558B2} package for +creating styled terminal outputs. + + +Term provides a simple {italic green4 bold}markup{/italic green4 bold} +{italic green4 bold}language{/italic green4 bold} to add {bold bright_blue}color{/bold bright_blue} and {bold underline}styles{/bold underline} +to your text. +More complicated text layout +can be created using {red}"Renderable"{/red} +{red}{/red} objects such +as {red}"Panel"{/red} and {red}"TextBox"{/red}. +These can also be nested and +stacked to create {italic pink3}fancy{/italic pink3} and +{underline}informative{/underline} terminal ouputs +for your Julia code \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_2.txt b/test/txtfiles/reshaped_text_2.txt new file mode 100644 index 000000000..c0db40909 --- /dev/null +++ b/test/txtfiles/reshaped_text_2.txt @@ -0,0 +1,5 @@ +Lorem {red}ipsum dolor sit {underline}amet,{/underline}{/red} +{red}{underline}consectetur{/underline} adipiscing elit,{/red} +{red}{/red}{blue}sed do eiusmod tempor incididunt{/blue} +ut labore et dolore magna aliqua. + \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_3.txt b/test/txtfiles/reshaped_text_3.txt new file mode 100644 index 000000000..054f9d0b6 --- /dev/null +++ b/test/txtfiles/reshaped_text_3.txt @@ -0,0 +1,4 @@ +Lorem{red}ipsumdolorsit{underline}amet, consectet{/underline}{/red} +{red}{underline}ur{/underline} adipiscing elit, {/red}seddoeiusmo{blue}dt{/blue} +{blue}emporincididunt{/blue}ut labore et +dolore magna aliqua. \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_4.txt b/test/txtfiles/reshaped_text_4.txt new file mode 100644 index 000000000..b4d898987 --- /dev/null +++ b/test/txtfiles/reshaped_text_4.txt @@ -0,0 +1,6 @@ +ต้าอ่วยวาทกรรมอาว์เซี้ยว กระดี๊กระด๊า +ช็อปซาดิสต์โมจิดีพาร์ตเมนต์ อินดอร์วิว +สี่แยกมาร์กจ๊อกกี้ โซนี่บัตเตอร์ฮันนีมูน +ยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข +่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์ +บอยคอตต์เฟอร์รี่บึมมาราธอน \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_5.txt b/test/txtfiles/reshaped_text_5.txt new file mode 100644 index 000000000..6b05c1251 --- /dev/null +++ b/test/txtfiles/reshaped_text_5.txt @@ -0,0 +1,6 @@ +ต้าอ่วยวาท{red}กรรมอาว์เซี้ยว กระดี๊กระด๊า{/red} +{red}{/red}ช็อปซาดิสต์โมจิดีพาร์ตเม{blue underline}นต์ อินดอร์วิว{/blue underline} +{blue underline}สี่แยกมาร์กจ๊อกกี้ โซนี่บัตเต{/blue underline}อร์ฮันนีมูน +ยาวีแพลนหงวนสคริปต์ แจ็กพ็อตต่อรองโทรโข +่งยากูซ่ารุมบ้า บอมบ์เบอร์รีวีเจดีพาร์ทเมนท์ +บอยคอตต์เฟอร์รี่บึมมาราธอน \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_6.txt b/test/txtfiles/reshaped_text_6.txt new file mode 100644 index 000000000..dcffef1f4 --- /dev/null +++ b/test/txtfiles/reshaped_text_6.txt @@ -0,0 +1,3 @@ +국가유공자·상이군경 및 전몰군경의 + 유가족은 법률이 정하는 바에 +의하여 \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_7.txt b/test/txtfiles/reshaped_text_7.txt new file mode 100644 index 000000000..61fe08b79 --- /dev/null +++ b/test/txtfiles/reshaped_text_7.txt @@ -0,0 +1,3 @@ +국{red}가유공자·상이군{bold}경 및 전{/bold}몰군경의{/red} +{red} 유{/red}가족은 법률이 정하는 바에 +의하여 \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_8.txt b/test/txtfiles/reshaped_text_8.txt new file mode 100644 index 000000000..06ad0384d --- /dev/null +++ b/test/txtfiles/reshaped_text_8.txt @@ -0,0 +1,5 @@ +朗眠裕安無際集正聞進士健音社野件草 +売規作独特認権価官家複入豚末告設悟 +自職遠氷育教載最週場仕踪持白炎組特 +曲強真雅立覧自価宰身訴側善論住理案 +者券真犯著避銀楽験館稿告 \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_9.txt b/test/txtfiles/reshaped_text_9.txt new file mode 100644 index 000000000..4b0d7ff35 --- /dev/null +++ b/test/txtfiles/reshaped_text_9.txt @@ -0,0 +1,3 @@ +┌────────────────┬─────────────── +─┬────────────────┬────────────── +──┬────────────── \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1.txt b/test/txtfiles/reshaped_text_markuo_1.txt new file mode 100644 index 000000000..107e4cc2f --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1.txt @@ -0,0 +1,4 @@ +{red}dasda asda dadasda{green}aadasdad{/green}dad{/red} +{red}asd ad ad ad asdad{bold}adada ad{/red} +{red}{bold}as sad ad ada{/red}ad adas sd ads{/bold} +{bold}{/bold} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_1.txt b/test/txtfiles/reshaped_text_markuo_1_1.txt new file mode 100644 index 000000000..5688bf686 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_1.txt @@ -0,0 +1,4 @@ +{red}dasda asda dadasda{green}aadasdad{/green}dad{/red} +{red}asd ad ad ad asdad{bold}adada ad{/bold}{/red} +{red}{bold}as sad ad ada{/red}ad adas sd ads{/bold} +{bold}{/bold} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_2.txt b/test/txtfiles/reshaped_text_markuo_1_2.txt new file mode 100644 index 000000000..c16acfc3e --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_2.txt @@ -0,0 +1,2 @@ +{red}adasd ad sa dsa{green} ad {blue} sd d ads{/blue}{/green}{/red} +{red}{green}{blue}ad {/blue}da dad {/green} asdsa dad a {/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_3.txt b/test/txtfiles/reshaped_text_markuo_1_3.txt new file mode 100644 index 000000000..c9dd991d2 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_3.txt @@ -0,0 +1,2 @@ +{red}adasd ad sa dsa{bold} ad {blue} sd d ads{/blue}{/bold}{/red} +{red}{bold}{blue}ad {/blue}da dad {/bold} asdsa dad a {/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_4.txt b/test/txtfiles/reshaped_text_markuo_1_4.txt new file mode 100644 index 000000000..ec64aeb16 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_4.txt @@ -0,0 +1,3 @@ +{red}adasd ad sa dsa{green} ad {blue} sd d ads{/blue}{/green}{/red} +{red}{green}{blue}ad da dad {/green} asdsa ddfsf {/blue}ad a{/red} +{red}{/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_5.txt b/test/txtfiles/reshaped_text_markuo_1_5.txt new file mode 100644 index 000000000..af62169ac --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_5.txt @@ -0,0 +1,3 @@ +{on_red}adasd ad sa dsa{green} ad {on_black} sd d ads{/on_black}{/green}{/on_red} +{on_red}{green}{on_black}ad da{/on_black} dad {/green} asdsa ddfsf ad a{/on_red} +{on_red}{/on_red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_6.txt b/test/txtfiles/reshaped_text_markuo_1_6.txt new file mode 100644 index 000000000..b2912d0da --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_6.txt @@ -0,0 +1,3 @@ +{on_(25, 25, 25)}adasd ad sa dsa{green} ad {on_black} sd d ads{/on_black}{/green}{/on_(25, 25, 25)} +{on_(25, 25, 25)}{green}{on_black}ad da{/on_black} {white}dad{/white} asad {/green} asdsa ddfsf{/on_(25, 25, 25)} +{on_(25, 25, 25)}ad a {/on_(25, 25, 25)} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_1_7.txt b/test/txtfiles/reshaped_text_markuo_1_7.txt new file mode 100644 index 000000000..12dd7d682 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_1_7.txt @@ -0,0 +1,6 @@ +{(220, 180, 150)} pink {bold}pink bold {dodger_blue2} pink bold{/dodger_blue2}{/bold}{/(220, 180, 150)} +{(220, 180, 150)}{bold}{dodger_blue2}blue {/dodger_blue2} pink bold {/bold} pink {on_(25, 55, 100)} pink{/on_(25, 55, 100)}{/(220, 180, 150)} +{(220, 180, 150)}{on_(25, 55, 100)}on blue {/(220, 180, 150)} just on blue {/on_(25, 55, 100)} NOW +SIMPLE WHITE {red} red red red {/red} +white white {underline} underline underline{/underline} +{underline} {/underline} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2.txt b/test/txtfiles/reshaped_text_markuo_2.txt new file mode 100644 index 000000000..107e4cc2f --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2.txt @@ -0,0 +1,4 @@ +{red}dasda asda dadasda{green}aadasdad{/green}dad{/red} +{red}asd ad ad ad asdad{bold}adada ad{/red} +{red}{bold}as sad ad ada{/red}ad adas sd ads{/bold} +{bold}{/bold} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_1.txt b/test/txtfiles/reshaped_text_markuo_2_1.txt new file mode 100644 index 000000000..5688bf686 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_1.txt @@ -0,0 +1,4 @@ +{red}dasda asda dadasda{green}aadasdad{/green}dad{/red} +{red}asd ad ad ad asdad{bold}adada ad{/bold}{/red} +{red}{bold}as sad ad ada{/red}ad adas sd ads{/bold} +{bold}{/bold} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_2.txt b/test/txtfiles/reshaped_text_markuo_2_2.txt new file mode 100644 index 000000000..c16acfc3e --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_2.txt @@ -0,0 +1,2 @@ +{red}adasd ad sa dsa{green} ad {blue} sd d ads{/blue}{/green}{/red} +{red}{green}{blue}ad {/blue}da dad {/green} asdsa dad a {/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_3.txt b/test/txtfiles/reshaped_text_markuo_2_3.txt new file mode 100644 index 000000000..c9dd991d2 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_3.txt @@ -0,0 +1,2 @@ +{red}adasd ad sa dsa{bold} ad {blue} sd d ads{/blue}{/bold}{/red} +{red}{bold}{blue}ad {/blue}da dad {/bold} asdsa dad a {/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_4.txt b/test/txtfiles/reshaped_text_markuo_2_4.txt new file mode 100644 index 000000000..ec64aeb16 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_4.txt @@ -0,0 +1,3 @@ +{red}adasd ad sa dsa{green} ad {blue} sd d ads{/blue}{/green}{/red} +{red}{green}{blue}ad da dad {/green} asdsa ddfsf {/blue}ad a{/red} +{red}{/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_5.txt b/test/txtfiles/reshaped_text_markuo_2_5.txt new file mode 100644 index 000000000..af62169ac --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_5.txt @@ -0,0 +1,3 @@ +{on_red}adasd ad sa dsa{green} ad {on_black} sd d ads{/on_black}{/green}{/on_red} +{on_red}{green}{on_black}ad da{/on_black} dad {/green} asdsa ddfsf ad a{/on_red} +{on_red}{/on_red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_6.txt b/test/txtfiles/reshaped_text_markuo_2_6.txt new file mode 100644 index 000000000..b2912d0da --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_6.txt @@ -0,0 +1,3 @@ +{on_(25, 25, 25)}adasd ad sa dsa{green} ad {on_black} sd d ads{/on_black}{/green}{/on_(25, 25, 25)} +{on_(25, 25, 25)}{green}{on_black}ad da{/on_black} {white}dad{/white} asad {/green} asdsa ddfsf{/on_(25, 25, 25)} +{on_(25, 25, 25)}ad a {/on_(25, 25, 25)} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_2_7.txt b/test/txtfiles/reshaped_text_markuo_2_7.txt new file mode 100644 index 000000000..12dd7d682 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_2_7.txt @@ -0,0 +1,6 @@ +{(220, 180, 150)} pink {bold}pink bold {dodger_blue2} pink bold{/dodger_blue2}{/bold}{/(220, 180, 150)} +{(220, 180, 150)}{bold}{dodger_blue2}blue {/dodger_blue2} pink bold {/bold} pink {on_(25, 55, 100)} pink{/on_(25, 55, 100)}{/(220, 180, 150)} +{(220, 180, 150)}{on_(25, 55, 100)}on blue {/(220, 180, 150)} just on blue {/on_(25, 55, 100)} NOW +SIMPLE WHITE {red} red red red {/red} +white white {underline} underline underline{/underline} +{underline} {/underline} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3.txt b/test/txtfiles/reshaped_text_markuo_3.txt new file mode 100644 index 000000000..aa40a0310 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3.txt @@ -0,0 +1,7 @@ +{red}dasda asda dadasda{green}aa{/red} +{red}{green}dasdad{/green}dad{/red} +{red}asd ad ad ad asdad{bold}ad{/red} +{red}{bold}ada ad{/red}{/bold} +{red}{bold}as sad ad ada{/red}ad{/bold} +{bold}adas sd ads{/bold} +{bold}{/bold} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_1.txt b/test/txtfiles/reshaped_text_markuo_3_1.txt new file mode 100644 index 000000000..bcbcc0cd1 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_1.txt @@ -0,0 +1,7 @@ +{red}dasda asda dadasda{green}aa{/green}{/red} +{red}{green}dasdad{/green}dad{/red} +{red}asd ad ad ad asdad{bold}ad{/bold}{/red} +{red}{bold}ada ad{/bold}{/red} +{red}{bold}as sad ad ada{/red}ad{/bold} +{bold}adas sd ads{/bold} +{bold}{/bold} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_2.txt b/test/txtfiles/reshaped_text_markuo_3_2.txt new file mode 100644 index 000000000..c513b6ca5 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_2.txt @@ -0,0 +1,4 @@ +{red}adasd ad sa dsa{green}{/green}{/red} +{red}{green}ad {blue} sd d ads{/blue}{/green}{/red} +{red}{green}{blue}ad {/blue}da dad {/green} asdsa{/red} +{red}dad a {/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_3.txt b/test/txtfiles/reshaped_text_markuo_3_3.txt new file mode 100644 index 000000000..f1e5057d8 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_3.txt @@ -0,0 +1,4 @@ +{red}adasd ad sa dsa{bold}{/bold}{/red} +{red}{bold}ad {blue} sd d ads{/blue}{/bold}{/red} +{red}{bold}{blue}ad {/blue}da dad {/bold} asdsa{/red} +{red}dad a {/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_4.txt b/test/txtfiles/reshaped_text_markuo_3_4.txt new file mode 100644 index 000000000..c11306925 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_4.txt @@ -0,0 +1,5 @@ +{red}adasd ad sa dsa{green}{/green}{/red} +{red}{green}ad {blue} sd d ads{/blue}{/green}{/red} +{red}{green}{blue}ad da dad {/green} asdsa{/blue}{/red} +{red}{blue}ddfsf {/blue}ad a{/red} +{red}{/red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_5.txt b/test/txtfiles/reshaped_text_markuo_3_5.txt new file mode 100644 index 000000000..a58d61108 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_5.txt @@ -0,0 +1,5 @@ +{on_red}adasd ad sa dsa{green}{/green}{/on_red} +{on_red}{green}ad {on_black} sd d ads{/on_black}{/green}{/on_red} +{on_red}{green}{on_black}ad da{/on_black} dad {/green} asdsa{/on_red} +{on_red}ddfsf ad a{/on_red} +{on_red}{/on_red} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_6.txt b/test/txtfiles/reshaped_text_markuo_3_6.txt new file mode 100644 index 000000000..4b38d97b5 --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_6.txt @@ -0,0 +1,5 @@ +{on_(25, 25, 25)}adasd ad sa dsa{green}{/green}{/on_(25, 25, 25)} +{on_(25, 25, 25)}{green}ad {on_black} sd d ads{/on_black}{/green}{/on_(25, 25, 25)} +{on_(25, 25, 25)}{green}{on_black}ad da{/on_black} {white}dad{/white} asad{/green}{/on_(25, 25, 25)} +{on_(25, 25, 25)}{green}{/green} asdsa ddfsf{/on_(25, 25, 25)} +{on_(25, 25, 25)}ad a {/on_(25, 25, 25)} \ No newline at end of file diff --git a/test/txtfiles/reshaped_text_markuo_3_7.txt b/test/txtfiles/reshaped_text_markuo_3_7.txt new file mode 100644 index 000000000..21a30199a --- /dev/null +++ b/test/txtfiles/reshaped_text_markuo_3_7.txt @@ -0,0 +1,11 @@ +{(220, 180, 150)} pink {bold}pink bold{/bold}{/(220, 180, 150)} +{(220, 180, 150)}{bold}{dodger_blue2} pink bold{/dodger_blue2}{/bold}{/(220, 180, 150)} +{(220, 180, 150)}{bold}{dodger_blue2}blue {/dodger_blue2} pink bold{/bold}{/(220, 180, 150)} +{(220, 180, 150)}{bold}{/bold} pink {on_(25, 55, 100)} pink{/on_(25, 55, 100)}{/(220, 180, 150)} +{(220, 180, 150)}{on_(25, 55, 100)}on blue {/(220, 180, 150)} just on{/on_(25, 55, 100)} +{on_(25, 55, 100)}blue {/on_(25, 55, 100)} NOW +SIMPLE WHITE {red} red{/red} +{red}red red {/red} +white white {underline} underli{/underline} +{underline}ne underline{/underline} +{underline} {/underline} \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_1_1.txt b/test/txtfiles/small_panel_title_1_1_1.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_1_1.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_1_2.txt b/test/txtfiles/small_panel_title_1_1_2.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_1_2.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_1_3.txt b/test/txtfiles/small_panel_title_1_1_3.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_1_3.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_2_1.txt b/test/txtfiles/small_panel_title_1_2_1.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_2_1.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_2_2.txt b/test/txtfiles/small_panel_title_1_2_2.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_2_2.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_2_3.txt b/test/txtfiles/small_panel_title_1_2_3.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_2_3.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_3_1.txt b/test/txtfiles/small_panel_title_1_3_1.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_3_1.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_3_2.txt b/test/txtfiles/small_panel_title_1_3_2.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_3_2.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_3_3.txt b/test/txtfiles/small_panel_title_1_3_3.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_3_3.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_4_1.txt b/test/txtfiles/small_panel_title_1_4_1.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_4_1.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_4_2.txt b/test/txtfiles/small_panel_title_1_4_2.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_4_2.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_1_4_3.txt b/test/txtfiles/small_panel_title_1_4_3.txt new file mode 100644 index 000000000..df8da5d1f --- /dev/null +++ b/test/txtfiles/small_panel_title_1_4_3.txt @@ -0,0 +1,3 @@ +╭───╮ +│ │ +╰───╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_1_1.txt b/test/txtfiles/small_panel_title_2_1_1.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_1_1.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_1_2.txt b/test/txtfiles/small_panel_title_2_1_2.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_1_2.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_1_3.txt b/test/txtfiles/small_panel_title_2_1_3.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_1_3.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_2_1.txt b/test/txtfiles/small_panel_title_2_2_1.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_2_1.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_2_2.txt b/test/txtfiles/small_panel_title_2_2_2.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_2_2.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_2_3.txt b/test/txtfiles/small_panel_title_2_2_3.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_2_3.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_3_1.txt b/test/txtfiles/small_panel_title_2_3_1.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_3_1.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_3_2.txt b/test/txtfiles/small_panel_title_2_3_2.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_3_2.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_3_3.txt b/test/txtfiles/small_panel_title_2_3_3.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_3_3.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_4_1.txt b/test/txtfiles/small_panel_title_2_4_1.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_4_1.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_4_2.txt b/test/txtfiles/small_panel_title_2_4_2.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_4_2.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_2_4_3.txt b/test/txtfiles/small_panel_title_2_4_3.txt new file mode 100644 index 000000000..d1ac44399 --- /dev/null +++ b/test/txtfiles/small_panel_title_2_4_3.txt @@ -0,0 +1,3 @@ +╭───────╮ +│ │ +╰───────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_1_1.txt b/test/txtfiles/small_panel_title_3_1_1.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_1_1.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_1_2.txt b/test/txtfiles/small_panel_title_3_1_2.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_1_2.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_1_3.txt b/test/txtfiles/small_panel_title_3_1_3.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_1_3.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_2_1.txt b/test/txtfiles/small_panel_title_3_2_1.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_2_1.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_2_2.txt b/test/txtfiles/small_panel_title_3_2_2.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_2_2.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_2_3.txt b/test/txtfiles/small_panel_title_3_2_3.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_2_3.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_3_1.txt b/test/txtfiles/small_panel_title_3_3_1.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_3_1.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_3_2.txt b/test/txtfiles/small_panel_title_3_3_2.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_3_2.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_3_3.txt b/test/txtfiles/small_panel_title_3_3_3.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_3_3.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_4_1.txt b/test/txtfiles/small_panel_title_3_4_1.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_4_1.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_4_2.txt b/test/txtfiles/small_panel_title_3_4_2.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_4_2.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_3_4_3.txt b/test/txtfiles/small_panel_title_3_4_3.txt new file mode 100644 index 000000000..3c8e297f4 --- /dev/null +++ b/test/txtfiles/small_panel_title_3_4_3.txt @@ -0,0 +1,3 @@ +╭────────╮ +│ │ +╰────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_1_1.txt b/test/txtfiles/small_panel_title_4_1_1.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_1_1.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_1_2.txt b/test/txtfiles/small_panel_title_4_1_2.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_1_2.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_1_3.txt b/test/txtfiles/small_panel_title_4_1_3.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_1_3.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_2_1.txt b/test/txtfiles/small_panel_title_4_2_1.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_2_1.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_2_2.txt b/test/txtfiles/small_panel_title_4_2_2.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_2_2.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_2_3.txt b/test/txtfiles/small_panel_title_4_2_3.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_2_3.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_3_1.txt b/test/txtfiles/small_panel_title_4_3_1.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_3_1.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_3_2.txt b/test/txtfiles/small_panel_title_4_3_2.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_3_2.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_3_3.txt b/test/txtfiles/small_panel_title_4_3_3.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_3_3.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_4_1.txt b/test/txtfiles/small_panel_title_4_4_1.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_4_1.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_4_2.txt b/test/txtfiles/small_panel_title_4_4_2.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_4_2.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_4_4_3.txt b/test/txtfiles/small_panel_title_4_4_3.txt new file mode 100644 index 000000000..e7295f32a --- /dev/null +++ b/test/txtfiles/small_panel_title_4_4_3.txt @@ -0,0 +1,3 @@ +╭─────────╮ +│ │ +╰─────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_1_1.txt b/test/txtfiles/small_panel_title_5_1_1.txt new file mode 100644 index 000000000..aaf5f3b92 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_1_1.txt @@ -0,0 +1,3 @@ +╭──── aa ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_1_2.txt b/test/txtfiles/small_panel_title_5_1_2.txt new file mode 100644 index 000000000..afcf8fe20 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_1_2.txt @@ -0,0 +1,3 @@ +╭─── aa ───╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_1_3.txt b/test/txtfiles/small_panel_title_5_1_3.txt new file mode 100644 index 000000000..afcf8fe20 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_1_3.txt @@ -0,0 +1,3 @@ +╭─── aa ───╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_2_1.txt b/test/txtfiles/small_panel_title_5_2_1.txt new file mode 100644 index 000000000..d78bc80e4 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_2_1.txt @@ -0,0 +1,3 @@ +╭── aaaa ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_2_2.txt b/test/txtfiles/small_panel_title_5_2_2.txt new file mode 100644 index 000000000..d78bc80e4 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_2_2.txt @@ -0,0 +1,3 @@ +╭── aaaa ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_2_3.txt b/test/txtfiles/small_panel_title_5_2_3.txt new file mode 100644 index 000000000..0a549bef7 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_2_3.txt @@ -0,0 +1,3 @@ +╭─ aaaa ───╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_3_1.txt b/test/txtfiles/small_panel_title_5_3_1.txt new file mode 100644 index 000000000..20eb27199 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_3_1.txt @@ -0,0 +1,3 @@ +╭── a... ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_3_2.txt b/test/txtfiles/small_panel_title_5_3_2.txt new file mode 100644 index 000000000..20eb27199 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_3_2.txt @@ -0,0 +1,3 @@ +╭── a... ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_3_3.txt b/test/txtfiles/small_panel_title_5_3_3.txt new file mode 100644 index 000000000..4217353e6 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_3_3.txt @@ -0,0 +1,3 @@ +╭─ a... ───╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_4_1.txt b/test/txtfiles/small_panel_title_5_4_1.txt new file mode 100644 index 000000000..20eb27199 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_4_1.txt @@ -0,0 +1,3 @@ +╭── a... ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_4_2.txt b/test/txtfiles/small_panel_title_5_4_2.txt new file mode 100644 index 000000000..20eb27199 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_4_2.txt @@ -0,0 +1,3 @@ +╭── a... ──╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_5_4_3.txt b/test/txtfiles/small_panel_title_5_4_3.txt new file mode 100644 index 000000000..4217353e6 --- /dev/null +++ b/test/txtfiles/small_panel_title_5_4_3.txt @@ -0,0 +1,3 @@ +╭─ a... ───╮ +│ │ +╰──────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_1_1.txt b/test/txtfiles/small_panel_title_6_1_1.txt new file mode 100644 index 000000000..042ae5b9d --- /dev/null +++ b/test/txtfiles/small_panel_title_6_1_1.txt @@ -0,0 +1,3 @@ +╭──── aa ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_1_2.txt b/test/txtfiles/small_panel_title_6_1_2.txt new file mode 100644 index 000000000..3a38d6dc8 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_1_2.txt @@ -0,0 +1,3 @@ +╭─── aa ────╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_1_3.txt b/test/txtfiles/small_panel_title_6_1_3.txt new file mode 100644 index 000000000..042ae5b9d --- /dev/null +++ b/test/txtfiles/small_panel_title_6_1_3.txt @@ -0,0 +1,3 @@ +╭──── aa ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_2_1.txt b/test/txtfiles/small_panel_title_6_2_1.txt new file mode 100644 index 000000000..f055e4166 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_2_1.txt @@ -0,0 +1,3 @@ +╭──── aaaa ─╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_2_2.txt b/test/txtfiles/small_panel_title_6_2_2.txt new file mode 100644 index 000000000..a842ff4f9 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_2_2.txt @@ -0,0 +1,3 @@ +╭── aaaa ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_2_3.txt b/test/txtfiles/small_panel_title_6_2_3.txt new file mode 100644 index 000000000..a842ff4f9 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_2_3.txt @@ -0,0 +1,3 @@ +╭── aaaa ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_3_1.txt b/test/txtfiles/small_panel_title_6_3_1.txt new file mode 100644 index 000000000..39836b217 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_3_1.txt @@ -0,0 +1,3 @@ +╭──── a... ─╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_3_2.txt b/test/txtfiles/small_panel_title_6_3_2.txt new file mode 100644 index 000000000..40c577882 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_3_2.txt @@ -0,0 +1,3 @@ +╭── a... ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_3_3.txt b/test/txtfiles/small_panel_title_6_3_3.txt new file mode 100644 index 000000000..40c577882 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_3_3.txt @@ -0,0 +1,3 @@ +╭── a... ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_4_1.txt b/test/txtfiles/small_panel_title_6_4_1.txt new file mode 100644 index 000000000..39836b217 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_4_1.txt @@ -0,0 +1,3 @@ +╭──── a... ─╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_4_2.txt b/test/txtfiles/small_panel_title_6_4_2.txt new file mode 100644 index 000000000..40c577882 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_4_2.txt @@ -0,0 +1,3 @@ +╭── a... ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_6_4_3.txt b/test/txtfiles/small_panel_title_6_4_3.txt new file mode 100644 index 000000000..40c577882 --- /dev/null +++ b/test/txtfiles/small_panel_title_6_4_3.txt @@ -0,0 +1,3 @@ +╭── a... ───╮ +│ │ +╰───────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_1_1.txt b/test/txtfiles/small_panel_title_7_1_1.txt new file mode 100644 index 000000000..a2c55e6ba --- /dev/null +++ b/test/txtfiles/small_panel_title_7_1_1.txt @@ -0,0 +1,3 @@ +╭──── aa ────╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_1_2.txt b/test/txtfiles/small_panel_title_7_1_2.txt new file mode 100644 index 000000000..a2c55e6ba --- /dev/null +++ b/test/txtfiles/small_panel_title_7_1_2.txt @@ -0,0 +1,3 @@ +╭──── aa ────╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_1_3.txt b/test/txtfiles/small_panel_title_7_1_3.txt new file mode 100644 index 000000000..d92d6d09c --- /dev/null +++ b/test/txtfiles/small_panel_title_7_1_3.txt @@ -0,0 +1,3 @@ +╭───── aa ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_2_1.txt b/test/txtfiles/small_panel_title_7_2_1.txt new file mode 100644 index 000000000..7fd599ba9 --- /dev/null +++ b/test/txtfiles/small_panel_title_7_2_1.txt @@ -0,0 +1,3 @@ +╭──── aaaa ──╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_2_2.txt b/test/txtfiles/small_panel_title_7_2_2.txt new file mode 100644 index 000000000..1dd35c1a1 --- /dev/null +++ b/test/txtfiles/small_panel_title_7_2_2.txt @@ -0,0 +1,3 @@ +╭─── aaaa ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_2_3.txt b/test/txtfiles/small_panel_title_7_2_3.txt new file mode 100644 index 000000000..1dd35c1a1 --- /dev/null +++ b/test/txtfiles/small_panel_title_7_2_3.txt @@ -0,0 +1,3 @@ +╭─── aaaa ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_3_1.txt b/test/txtfiles/small_panel_title_7_3_1.txt new file mode 100644 index 000000000..55fd33ac6 --- /dev/null +++ b/test/txtfiles/small_panel_title_7_3_1.txt @@ -0,0 +1,3 @@ +╭──── a... ──╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_3_2.txt b/test/txtfiles/small_panel_title_7_3_2.txt new file mode 100644 index 000000000..91c97bb9b --- /dev/null +++ b/test/txtfiles/small_panel_title_7_3_2.txt @@ -0,0 +1,3 @@ +╭─── a... ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_3_3.txt b/test/txtfiles/small_panel_title_7_3_3.txt new file mode 100644 index 000000000..91c97bb9b --- /dev/null +++ b/test/txtfiles/small_panel_title_7_3_3.txt @@ -0,0 +1,3 @@ +╭─── a... ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_4_1.txt b/test/txtfiles/small_panel_title_7_4_1.txt new file mode 100644 index 000000000..55fd33ac6 --- /dev/null +++ b/test/txtfiles/small_panel_title_7_4_1.txt @@ -0,0 +1,3 @@ +╭──── a... ──╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_4_2.txt b/test/txtfiles/small_panel_title_7_4_2.txt new file mode 100644 index 000000000..91c97bb9b --- /dev/null +++ b/test/txtfiles/small_panel_title_7_4_2.txt @@ -0,0 +1,3 @@ +╭─── a... ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_7_4_3.txt b/test/txtfiles/small_panel_title_7_4_3.txt new file mode 100644 index 000000000..91c97bb9b --- /dev/null +++ b/test/txtfiles/small_panel_title_7_4_3.txt @@ -0,0 +1,3 @@ +╭─── a... ───╮ +│ │ +╰────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_1_1.txt b/test/txtfiles/small_panel_title_8_1_1.txt new file mode 100644 index 000000000..c3b3626bc --- /dev/null +++ b/test/txtfiles/small_panel_title_8_1_1.txt @@ -0,0 +1,3 @@ +╭──── aa ─────╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_1_2.txt b/test/txtfiles/small_panel_title_8_1_2.txt new file mode 100644 index 000000000..c3b3626bc --- /dev/null +++ b/test/txtfiles/small_panel_title_8_1_2.txt @@ -0,0 +1,3 @@ +╭──── aa ─────╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_1_3.txt b/test/txtfiles/small_panel_title_8_1_3.txt new file mode 100644 index 000000000..2ab16d1e1 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_1_3.txt @@ -0,0 +1,3 @@ +╭────── aa ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_2_1.txt b/test/txtfiles/small_panel_title_8_2_1.txt new file mode 100644 index 000000000..ffe2714b2 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_2_1.txt @@ -0,0 +1,3 @@ +╭──── aaaa ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_2_2.txt b/test/txtfiles/small_panel_title_8_2_2.txt new file mode 100644 index 000000000..7673c0be9 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_2_2.txt @@ -0,0 +1,3 @@ +╭─── aaaa ────╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_2_3.txt b/test/txtfiles/small_panel_title_8_2_3.txt new file mode 100644 index 000000000..ffe2714b2 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_2_3.txt @@ -0,0 +1,3 @@ +╭──── aaaa ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_3_1.txt b/test/txtfiles/small_panel_title_8_3_1.txt new file mode 100644 index 000000000..596643ab5 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_3_1.txt @@ -0,0 +1,3 @@ +╭──── a... ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_3_2.txt b/test/txtfiles/small_panel_title_8_3_2.txt new file mode 100644 index 000000000..e178dd43c --- /dev/null +++ b/test/txtfiles/small_panel_title_8_3_2.txt @@ -0,0 +1,3 @@ +╭─── a... ────╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_3_3.txt b/test/txtfiles/small_panel_title_8_3_3.txt new file mode 100644 index 000000000..596643ab5 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_3_3.txt @@ -0,0 +1,3 @@ +╭──── a... ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_4_1.txt b/test/txtfiles/small_panel_title_8_4_1.txt new file mode 100644 index 000000000..596643ab5 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_4_1.txt @@ -0,0 +1,3 @@ +╭──── a... ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_4_2.txt b/test/txtfiles/small_panel_title_8_4_2.txt new file mode 100644 index 000000000..e178dd43c --- /dev/null +++ b/test/txtfiles/small_panel_title_8_4_2.txt @@ -0,0 +1,3 @@ +╭─── a... ────╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/small_panel_title_8_4_3.txt b/test/txtfiles/small_panel_title_8_4_3.txt new file mode 100644 index 000000000..596643ab5 --- /dev/null +++ b/test/txtfiles/small_panel_title_8_4_3.txt @@ -0,0 +1,3 @@ +╭──── a... ───╮ +│ │ +╰─────────────╯ \ No newline at end of file diff --git a/test/txtfiles/str_trunc_1.txt b/test/txtfiles/str_trunc_1.txt new file mode 100644 index 000000000..9996ad3fa --- /dev/null +++ b/test/txtfiles/str_trunc_1.txt @@ -0,0 +1,4 @@ +Lorem... + consecte... +tempor... + magna... \ No newline at end of file diff --git a/test/txtfiles/str_trunc_2.txt b/test/txtfiles/str_trunc_2.txt new file mode 100644 index 000000000..a17b2aee8 --- /dev/null +++ b/test/txtfiles/str_trunc_2.txt @@ -0,0 +1,4 @@ +Lorem ipsum dolor sit amet, + consectetur adipiscing elit, sed do eiusmod +tempor incididunt ut labore et dolore + magna aliqua. \ No newline at end of file diff --git a/test/txtfiles/str_trunc_3.txt b/test/txtfiles/str_trunc_3.txt new file mode 100644 index 000000000..08d3430f6 --- /dev/null +++ b/test/txtfiles/str_trunc_3.txt @@ -0,0 +1,4 @@ +Lorem ipsum dolor sit amet, + consectetur adipiscing... +tempor incididunt ut labore... + magna aliqua. \ No newline at end of file diff --git a/test/txtfiles/table_1.txt b/test/txtfiles/table_1.txt index 5180ee985..e9b5d163d 100644 --- a/test/txtfiles/table_1.txt +++ b/test/txtfiles/table_1.txt @@ -1,13 +1,13 @@  ╷ ╷    Column1 │ Column2 │ Column3   ╺━━━━━━━━━━━┿━━━━━━━━━━━┿━━━━━━━━━━━━╸ -  1 │ 1.0 │ 100000.0   +  1 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  2 │ 1.0 │ 100000.0   +  2 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  3 │ 1.0 │ 100000.0   +  3 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  4 │ 1.0 │ 100000.0   +  4 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  5 │ 1.0 │ 100000.0   +  5 │ 1.0 │ 100000.0    ╵ ╵  \ No newline at end of file diff --git a/test/txtfiles/table_4.txt b/test/txtfiles/table_4.txt index cb2367f3a..d608fe3c7 100644 --- a/test/txtfiles/table_4.txt +++ b/test/txtfiles/table_4.txt @@ -1,15 +1,15 @@  ╷ ╷    Column1 │ Column2 │ Column3   ╺━━━━━━━━━━━┿━━━━━━━━━━━┿━━━━━━━━━━━━╸ -  1 │ 1.0 │ 100000.0   +  1 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  2 │ 1.0 │ 100000.0   +  2 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  3 │ 1.0 │ 100000.0   +  3 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  4 │ 1.0 │ 100000.0   +  4 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴ -  5 │ 1.0 │ 100000.0   +  5 │ 1.0 │ 100000.0   ╶───────────┼───────────┼────────────╴   get │ a │ footer    ╵ ╵  \ No newline at end of file diff --git a/test/txtfiles/table_5.txt b/test/txtfiles/table_5.txt index 4ec08c480..af3bab61e 100644 --- a/test/txtfiles/table_5.txt +++ b/test/txtfiles/table_5.txt @@ -1,15 +1,15 @@  ╷ ╷    Column1 │ Column2 │ Column3   ╺━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━╸ -  1 │ 1.0 │ 100000.0   +  1 │ 1.0 │ 100000.0   ╶──────────────────┼──────────────────┼──────────────────╴ -  2 │ 1.0 │ 100000.0   +  2 │ 1.0 │ 100000.0   ╶──────────────────┼──────────────────┼──────────────────╴ -  3 │ 1.0 │ 100000.0   +  3 │ 1.0 │ 100000.0   ╶──────────────────┼──────────────────┼──────────────────╴ -  4 │ 1.0 │ 100000.0   +  4 │ 1.0 │ 100000.0   ╶──────────────────┼──────────────────┼──────────────────╴ -  5 │ 1.0 │ 100000.0   +  5 │ 1.0 │ 100000.0   ╶──────────────────┼──────────────────┼──────────────────╴   couldn't apply │ couldn't apply │ couldn't apply    ╵ ╵  \ No newline at end of file diff --git a/test/txtfiles/table_7.txt b/test/txtfiles/table_7.txt index 9c9c4034b..cd098b599 100644 --- a/test/txtfiles/table_7.txt +++ b/test/txtfiles/table_7.txt @@ -1,15 +1,15 @@   -  Column1   Co...   Co...   +  Column1   Co...   Co...    ─────────────────────────────────────────  -  1   1.0   10...   +  1   1.0   10...     -  2   1.0   10...   +  2   1.0   10...     -  3   1.0   10...   +  3   1.0   10...     -  4   1.0   10...   +  4   1.0   10...     -  5   1.0   10...   +  5   1.0   10...    ─────────────────────────────────────────  -  couldn't apply   co...   co...   +  couldn't apply   co...   co...     \ No newline at end of file diff --git a/test/txtfiles/table_8.txt b/test/txtfiles/table_8.txt index ab91a1a63..da243d29b 100644 --- a/test/txtfiles/table_8.txt +++ b/test/txtfiles/table_8.txt @@ -1,13 +1,13 @@  ╷ ╷    Column1 │ Column2 │ Column3   ╺━━━━━━━━━━━━┿━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━╸ -  0.79855... │ 0.003... │ 0.5023663197115882   +  0.79855... │ 0.003... │ 0.5023663197115882   ╶────────────┼──────────┼──────────────────────╴ -  0.95965... │ 0.468... │ 0.38987016627250015   +  0.95965... │ 0.468... │ 0.38987016627250015   ╶────────────┼──────────┼──────────────────────╴ -  0.32684... │ 0.360... │ 0.9474887990061425   +  0.32684... │ 0.360... │ 0.9474887990061425   ╶────────────┼──────────┼──────────────────────╴ -  0.98503... │ 0.954... │ 0.3554115446908739   +  0.98503... │ 0.954... │ 0.3554115446908739   ╶────────────┼──────────┼──────────────────────╴ -  0.67459... │ 0.130... │ 0.8356019600603017   +  0.67459... │ 0.130... │ 0.8356019600603017    ╵ ╵  \ No newline at end of file diff --git a/test/txtfiles/termshow_1.txt b/test/txtfiles/termshow_1.txt index 2f449b6bb..ee08381c2 100644 --- a/test/txtfiles/termshow_1.txt +++ b/test/txtfiles/termshow_1.txt @@ -1,8 +1,8 @@ -╭─────────────────╮ -│ │ -│   (1)   1   │ -│   (2)   2   │ -│   (3)   3   │ -│   │ -│ │ -╰───── 3 items ───╯ +╭─────────────────╮ +│ │ +│   (1)   1   │ +│   (2)   2   │ +│   (3)   3   │ +│   │ +│ │ +╰──────── 3... ───╯ diff --git a/test/txtfiles/termshow_10.txt b/test/txtfiles/termshow_10.txt index 83fa9efe8..617834d03 100644 --- a/test/txtfiles/termshow_10.txt +++ b/test/txtfiles/termshow_10.txt @@ -1,13 +1,13 @@ -╭──── Matrix {Float64}  ────────────────╮ -│ │ -│   │ -│     (1)   (2)   (3)   (4)   (5)   │ -│   │ -│   (1)   0.0   0.0   0.0   0.0   0.0   │ -│   (2)   0.0   0.0   0.0   0.0   0.0   │ -│   (3)   0.0   0.0   0.0   0.0   0.0   │ -│   (4)   0.0   0.0   0.0   0.0   0.0   │ -│   (5)   0.0   0.0   0.0   0.0   0.0   │ -│   │ -│ │ -╰──────────────────────────── 5 × 5  ───╯ +╭──── Matrix {Float64}  ────────────────╮ +│ │ +│   │ +│     (1)   (2)   (3)   (4)   (5)   │ +│   │ +│   (1)   0.0   0.0   0.0   0.0   0.0   │ +│   (2)   0.0   0.0   0.0   0.0   0.0   │ +│   (3)   0.0   0.0   0.0   0.0   0.0   │ +│   (4)   0.0   0.0   0.0   0.0   0.0   │ +│   (5)   0.0   0.0   0.0   0.0   0.0   │ +│   │ +│ │ +╰──────────────────────────── 5 × 5  ───╯ diff --git a/test/txtfiles/termshow_11.txt b/test/txtfiles/termshow_11.txt new file mode 100644 index 000000000..5cd786124 --- /dev/null +++ b/test/txtfiles/termshow_11.txt @@ -0,0 +1,347 @@ +╭──── Array {Float64, 3}  ───────────────────────╮ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 1] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 2] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 3] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 4] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 5] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 6] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 7] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 8] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰────────────────────────────── [:, :, 9] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   (4)   (100)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (2)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (3)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (4)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (5)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (6)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (7)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (8)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (9)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (10)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (11)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (12)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (13)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (14)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (15)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (16)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (17)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (18)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (19)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (20)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (21)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (22)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (23)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (24)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │   (25)   0.0   0.0   0.0   0.0   ⋯   │ │ +│ │     ⋮   ⋮   ⋮   ⋮   ⋱   │ │ +│ │   │ │ +│ ╰───────────────────────────── [:, :, 10] ───╯ │ +│ │ +│ │ +│ ╭────────────────────────────────────────────╮ │ +│ │ 90 frames omitted │ │ +│ ╰────────────────────────────────────────────╯ │ +│ │ +╰──────────────────────────── 100 × 100 × 100 ───╯ diff --git a/test/txtfiles/termshow_12.txt b/test/txtfiles/termshow_12.txt new file mode 100644 index 000000000..c99e33159 --- /dev/null +++ b/test/txtfiles/termshow_12.txt @@ -0,0 +1,109 @@ + ╭─────────────────────────────────────────────────────────────────────────╮ + │ │ + │ Panel <: Term.Panels.AbstractPanel │ + │ │segments ::Vector │ + │ │ measure ::Term.Measures.Measure │ + │ │ + ╰─────────────────────────────────────────────────────────────────────────╯ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ┌──────────────────────────────────────────────────────────────────┐ + │ Panel  │ + └──────────────────────────────────────────────────────────────────┘ + +`Renderable` with a panel surrounding some content: + + ┌──────────────────────────────────────────────────────────────────┐ + │  ╭──────────╮  │ + │  │ my panel │  │ + │  ╰──────────╯  │ + └──────────────────────────────────────────────────────────────────┘ + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +When constructing a Panel, several keyword arguments can be used to set its +appearance: + + • box::Symbol sets the `Box` type for the Panel's border + • style::String sets the box's style (e.g., color) + • title::Union sets the Panel's title + • title_style::Union sets the title's style + • title_justify::Symbol sets the location of the title + • subtitle::Union sets the Panel's subtitle + • subtitle_style::Union sets the subtitle's style + • subtitle_justify::Symbol sets the location of the subtitle + • justify::Symbol sets text's alignment (:left, :rigth, :center, :justify) + + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + ┌──────────────────────────────────────────────────────────────────┐ + │ Panel(;   │ + │  fit::Bool = false,  │ + │  height::Int = 2,  │ + │  width::Int = 80,  │ + │  padding::Union{{Vector,Padding,NTuple}} = Padding(0,  │ + │ 0, 0, 0),  │ + │  kwargs...,   │ + │ )  │ + └──────────────────────────────────────────────────────────────────┘ + +Construct a `Panel` with no content. + + Examples + + ┌──────────────────────────────────────────────────────────────────┐ + │ julia> Panel(height=5, width=10)  │ + │ ╭────────╮  │ + │ │ │  │ + │ │ │  │ + │ │ │  │ + │ ╰────────╯  │ + │   │ + │ julia> Panel(height=3, width=5)  │ + │ ╭───╮  │ + │ │ │  │ + │ ╰───╯  │ + └──────────────────────────────────────────────────────────────────┘ + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + ┌──────────────────────────────────────────────────────────────────┐ + │ Panel(  │ + │  content::Union{{AbstractString,AbstractRenderable}};  │ + │  fit::Bool = false,  │ + │  padding::Union{{Nothing,Padding,NTuple}} = nothing,  │ + │  kwargs...,  │ + │ )  │ + └──────────────────────────────────────────────────────────────────┘ + +Construct a `Panel` around an `AbstractRenderable` or `AbstractString`. + +This is the main Panel-creating function, it dispatches to other methods based +on the value of `fit` to either fith the `Panel` to its content or vice versa. + +`kwargs` can be used to set various aspects of the `Panel`'s appearance like +the presence and style of titles, box type etc... see render (@ref) below. + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + ┌──────────────────────────────────────────────────────────────────┐ + │ Panel(  │ + │  content::Union{{AbstractString,AbstractRenderable}},  │ + │  ::Val{{true}},  │ + │  padding::Padding;  │ + │  height::Union{{Nothing,Int}} = nothing,  │ + │  width::Union{{Nothing,Int}} = nothing,  │ + │  trim::Bool = true,  │ + │  kwargs...,  │ + │ )  │ + └──────────────────────────────────────────────────────────────────┘ + +Construct a `Panel` fitting the content's width. + + ╭──── Warning ─────────────────────────────────────────────────────────╮ + │ If the content is larger than the console terminal's width, │ + │ it will │ + │ get trimmed │ + │ to avoid overflow, unless `trim=false` is given. │ + ╰──────────────────────────────────────────────────────────────────────╯ +28 lines omitted... \ No newline at end of file diff --git a/test/txtfiles/termshow_2.txt b/test/txtfiles/termshow_2.txt index 9c45d7b8c..a545e0a55 100644 --- a/test/txtfiles/termshow_2.txt +++ b/test/txtfiles/termshow_2.txt @@ -1,6 +1,6 @@ -╭──── Dict {Any, Any}  ──────────────────────────╮ -│ │ -│  {String} │ a => Dict(:z => "a") │  {Dict}  │ -│  {Symbol} │ x => [1, 2, 3] │ {Vector}  │ -│ │ -╰──────────────────────────────────── 2 items ───╯ +╭──── Dict {Any, Any}  ──────────────────────────╮ +│ │ +│  {String} │ a => Dict(:z => "a") │  {Dict}  │ +│  {Symbol} │ x => [1, 2, 3] │ {Vector}  │ +│ │ +╰──────────────────────────────────── 2 items ───╯ diff --git a/test/txtfiles/termshow_3.txt b/test/txtfiles/termshow_3.txt index 4d6b2ce4f..1a2e7702c 100644 --- a/test/txtfiles/termshow_3.txt +++ b/test/txtfiles/termshow_3.txt @@ -1,15 +1,15 @@ -╭──── Dict {Int64, Int64}  ────────╮ -│ │ -│  {Int64} │ 5 => 5 │ {Int64}  │ -│  {Int64} │ 56 => 56 │ {Int64}  │ -│  {Int64} │ 35 => 35 │ {Int64}  │ -│  {Int64} │ 55 => 55 │ {Int64}  │ -│  {Int64} │ 60 => 60 │ {Int64}  │ -│  {Int64} │ 30 => 30 │ {Int64}  │ -│  {Int64} │ 32 => 32 │ {Int64}  │ -│  {Int64} │ 6 => 6 │ {Int64}  │ -│  {Int64} │ 67 => 67 │ {Int64}  │ -│  {Int64} │ 45 => 45 │ {Int64}  │ -│ ⋮ │ ⋮ ⋮ │ ⋮ │ -│ │ -╰──────────────────── 100 items ───╯ +╭──── Dict {Int64, Int64}  ────────╮ +│ │ +│  {Int64} │ 5 => 5 │ {Int64}  │ +│  {Int64} │ 56 => 56 │ {Int64}  │ +│  {Int64} │ 35 => 35 │ {Int64}  │ +│  {Int64} │ 55 => 55 │ {Int64}  │ +│  {Int64} │ 60 => 60 │ {Int64}  │ +│  {Int64} │ 30 => 30 │ {Int64}  │ +│  {Int64} │ 32 => 32 │ {Int64}  │ +│  {Int64} │ 6 => 6 │ {Int64}  │ +│  {Int64} │ 67 => 67 │ {Int64}  │ +│  {Int64} │ 45 => 45 │ {Int64}  │ +│ ⋮ │ ⋮ ⋮ │ ⋮ │ +│ │ +╰──────────────────── 100 items ───╯ diff --git a/test/txtfiles/termshow_4.txt b/test/txtfiles/termshow_4.txt index 3996ee540..294f4ed33 100644 --- a/test/txtfiles/termshow_4.txt +++ b/test/txtfiles/termshow_4.txt @@ -1,59 +1,59 @@ -╭──── Matrix {Float64}  ───────────────────╮ -│ │ -│   │ -│     (1)   (2)   (3)   (4)   (300)   │ -│   │ -│   (1)   0.0   0.0   0.0   0.0   ⋯   │ -│   (2)   0.0   0.0   0.0   0.0   ⋯   │ -│   (3)   0.0   0.0   0.0   0.0   ⋯   │ -│   (4)   0.0   0.0   0.0   0.0   ⋯   │ -│   (5)   0.0   0.0   0.0   0.0   ⋯   │ -│   (6)   0.0   0.0   0.0   0.0   ⋯   │ -│   (7)   0.0   0.0   0.0   0.0   ⋯   │ -│   (8)   0.0   0.0   0.0   0.0   ⋯   │ -│   (9)   0.0   0.0   0.0   0.0   ⋯   │ -│   (10)   0.0   0.0   0.0   0.0   ⋯   │ -│   (11)   0.0   0.0   0.0   0.0   ⋯   │ -│   (12)   0.0   0.0   0.0   0.0   ⋯   │ -│   (13)   0.0   0.0   0.0   0.0   ⋯   │ -│   (14)   0.0   0.0   0.0   0.0   ⋯   │ -│   (15)   0.0   0.0   0.0   0.0   ⋯   │ -│   (16)   0.0   0.0   0.0   0.0   ⋯   │ -│   (17)   0.0   0.0   0.0   0.0   ⋯   │ -│   (18)   0.0   0.0   0.0   0.0   ⋯   │ -│   (19)   0.0   0.0   0.0   0.0   ⋯   │ -│   (20)   0.0   0.0   0.0   0.0   ⋯   │ -│   (21)   0.0   0.0   0.0   0.0   ⋯   │ -│   (22)   0.0   0.0   0.0   0.0   ⋯   │ -│   (23)   0.0   0.0   0.0   0.0   ⋯   │ -│   (24)   0.0   0.0   0.0   0.0   ⋯   │ -│   (25)   0.0   0.0   0.0   0.0   ⋯   │ -│   (26)   0.0   0.0   0.0   0.0   ⋯   │ -│   (27)   0.0   0.0   0.0   0.0   ⋯   │ -│   (28)   0.0   0.0   0.0   0.0   ⋯   │ -│   (29)   0.0   0.0   0.0   0.0   ⋯   │ -│   (30)   0.0   0.0   0.0   0.0   ⋯   │ -│   (31)   0.0   0.0   0.0   0.0   ⋯   │ -│   (32)   0.0   0.0   0.0   0.0   ⋯   │ -│   (33)   0.0   0.0   0.0   0.0   ⋯   │ -│   (34)   0.0   0.0   0.0   0.0   ⋯   │ -│   (35)   0.0   0.0   0.0   0.0   ⋯   │ -│   (36)   0.0   0.0   0.0   0.0   ⋯   │ -│   (37)   0.0   0.0   0.0   0.0   ⋯   │ -│   (38)   0.0   0.0   0.0   0.0   ⋯   │ -│   (39)   0.0   0.0   0.0   0.0   ⋯   │ -│   (40)   0.0   0.0   0.0   0.0   ⋯   │ -│   (41)   0.0   0.0   0.0   0.0   ⋯   │ -│   (42)   0.0   0.0   0.0   0.0   ⋯   │ -│   (43)   0.0   0.0   0.0   0.0   ⋯   │ -│   (44)   0.0   0.0   0.0   0.0   ⋯   │ -│   (45)   0.0   0.0   0.0   0.0   ⋯   │ -│   (46)   0.0   0.0   0.0   0.0   ⋯   │ -│   (47)   0.0   0.0   0.0   0.0   ⋯   │ -│   (48)   0.0   0.0   0.0   0.0   ⋯   │ -│   (49)   0.0   0.0   0.0   0.0   ⋯   │ -│   (50)   0.0   0.0   0.0   0.0   ⋯   │ -│     ⋮   ⋮   ⋮   ⋮   ⋱   │ -│   │ -│ │ -╰─────────────────────────── 120 × 300  ───╯ +╭──── Matrix {Float64}  ───────────────────╮ +│ │ +│   │ +│     (1)   (2)   (3)   (4)   (300)   │ +│   │ +│   (1)   0.0   0.0   0.0   0.0   ⋯   │ +│   (2)   0.0   0.0   0.0   0.0   ⋯   │ +│   (3)   0.0   0.0   0.0   0.0   ⋯   │ +│   (4)   0.0   0.0   0.0   0.0   ⋯   │ +│   (5)   0.0   0.0   0.0   0.0   ⋯   │ +│   (6)   0.0   0.0   0.0   0.0   ⋯   │ +│   (7)   0.0   0.0   0.0   0.0   ⋯   │ +│   (8)   0.0   0.0   0.0   0.0   ⋯   │ +│   (9)   0.0   0.0   0.0   0.0   ⋯   │ +│   (10)   0.0   0.0   0.0   0.0   ⋯   │ +│   (11)   0.0   0.0   0.0   0.0   ⋯   │ +│   (12)   0.0   0.0   0.0   0.0   ⋯   │ +│   (13)   0.0   0.0   0.0   0.0   ⋯   │ +│   (14)   0.0   0.0   0.0   0.0   ⋯   │ +│   (15)   0.0   0.0   0.0   0.0   ⋯   │ +│   (16)   0.0   0.0   0.0   0.0   ⋯   │ +│   (17)   0.0   0.0   0.0   0.0   ⋯   │ +│   (18)   0.0   0.0   0.0   0.0   ⋯   │ +│   (19)   0.0   0.0   0.0   0.0   ⋯   │ +│   (20)   0.0   0.0   0.0   0.0   ⋯   │ +│   (21)   0.0   0.0   0.0   0.0   ⋯   │ +│   (22)   0.0   0.0   0.0   0.0   ⋯   │ +│   (23)   0.0   0.0   0.0   0.0   ⋯   │ +│   (24)   0.0   0.0   0.0   0.0   ⋯   │ +│   (25)   0.0   0.0   0.0   0.0   ⋯   │ +│   (26)   0.0   0.0   0.0   0.0   ⋯   │ +│   (27)   0.0   0.0   0.0   0.0   ⋯   │ +│   (28)   0.0   0.0   0.0   0.0   ⋯   │ +│   (29)   0.0   0.0   0.0   0.0   ⋯   │ +│   (30)   0.0   0.0   0.0   0.0   ⋯   │ +│   (31)   0.0   0.0   0.0   0.0   ⋯   │ +│   (32)   0.0   0.0   0.0   0.0   ⋯   │ +│   (33)   0.0   0.0   0.0   0.0   ⋯   │ +│   (34)   0.0   0.0   0.0   0.0   ⋯   │ +│   (35)   0.0   0.0   0.0   0.0   ⋯   │ +│   (36)   0.0   0.0   0.0   0.0   ⋯   │ +│   (37)   0.0   0.0   0.0   0.0   ⋯   │ +│   (38)   0.0   0.0   0.0   0.0   ⋯   │ +│   (39)   0.0   0.0   0.0   0.0   ⋯   │ +│   (40)   0.0   0.0   0.0   0.0   ⋯   │ +│   (41)   0.0   0.0   0.0   0.0   ⋯   │ +│   (42)   0.0   0.0   0.0   0.0   ⋯   │ +│   (43)   0.0   0.0   0.0   0.0   ⋯   │ +│   (44)   0.0   0.0   0.0   0.0   ⋯   │ +│   (45)   0.0   0.0   0.0   0.0   ⋯   │ +│   (46)   0.0   0.0   0.0   0.0   ⋯   │ +│   (47)   0.0   0.0   0.0   0.0   ⋯   │ +│   (48)   0.0   0.0   0.0   0.0   ⋯   │ +│   (49)   0.0   0.0   0.0   0.0   ⋯   │ +│   (50)   0.0   0.0   0.0   0.0   ⋯   │ +│     ⋮   ⋮   ⋮   ⋮   ⋱   │ +│   │ +│ │ +╰─────────────────────────── 120 × 300  ───╯ diff --git a/test/txtfiles/termshow_5.txt b/test/txtfiles/termshow_5.txt index 8745cb56f..9775e8185 100644 --- a/test/txtfiles/termshow_5.txt +++ b/test/txtfiles/termshow_5.txt @@ -1,56 +1,56 @@ -╭────────────────────╮ -│ │ -│   (1)   0.0   │ -│   (2)   0.0   │ -│   (3)   0.0   │ -│   (4)   0.0   │ -│   (5)   0.0   │ -│   (6)   0.0   │ -│   (7)   0.0   │ -│   (8)   0.0   │ -│   (9)   0.0   │ -│   (10)   0.0   │ -│   (11)   0.0   │ -│   (12)   0.0   │ -│   (13)   0.0   │ -│   (14)   0.0   │ -│   (15)   0.0   │ -│   (16)   0.0   │ -│   (17)   0.0   │ -│   (18)   0.0   │ -│   (19)   0.0   │ -│   (20)   0.0   │ -│   (21)   0.0   │ -│   (22)   0.0   │ -│   (23)   0.0   │ -│   (24)   0.0   │ -│   (25)   0.0   │ -│   (26)   0.0   │ -│   (27)   0.0   │ -│   (28)   0.0   │ -│   (29)   0.0   │ -│   (30)   0.0   │ -│   (31)   0.0   │ -│   (32)   0.0   │ -│   (33)   0.0   │ -│   (34)   0.0   │ -│   (35)   0.0   │ -│   (36)   0.0   │ -│   (37)   0.0   │ -│   (38)   0.0   │ -│   (39)   0.0   │ -│   (40)   0.0   │ -│   (41)   0.0   │ -│   (42)   0.0   │ -│   (43)   0.0   │ -│   (44)   0.0   │ -│   (45)   0.0   │ -│   (46)   0.0   │ -│   (47)   0.0   │ -│   (48)   0.0   │ -│   (49)   0.0   │ -│   (50)   0.0   │ -│     ⋮   │ -│   │ -│ │ -╰────── 200 items ───╯ +╭────────────────────╮ +│ │ +│   (1)   0.0   │ +│   (2)   0.0   │ +│   (3)   0.0   │ +│   (4)   0.0   │ +│   (5)   0.0   │ +│   (6)   0.0   │ +│   (7)   0.0   │ +│   (8)   0.0   │ +│   (9)   0.0   │ +│   (10)   0.0   │ +│   (11)   0.0   │ +│   (12)   0.0   │ +│   (13)   0.0   │ +│   (14)   0.0   │ +│   (15)   0.0   │ +│   (16)   0.0   │ +│   (17)   0.0   │ +│   (18)   0.0   │ +│   (19)   0.0   │ +│   (20)   0.0   │ +│   (21)   0.0   │ +│   (22)   0.0   │ +│   (23)   0.0   │ +│   (24)   0.0   │ +│   (25)   0.0   │ +│   (26)   0.0   │ +│   (27)   0.0   │ +│   (28)   0.0   │ +│   (29)   0.0   │ +│   (30)   0.0   │ +│   (31)   0.0   │ +│   (32)   0.0   │ +│   (33)   0.0   │ +│   (34)   0.0   │ +│   (35)   0.0   │ +│   (36)   0.0   │ +│   (37)   0.0   │ +│   (38)   0.0   │ +│   (39)   0.0   │ +│   (40)   0.0   │ +│   (41)   0.0   │ +│   (42)   0.0   │ +│   (43)   0.0   │ +│   (44)   0.0   │ +│   (45)   0.0   │ +│   (46)   0.0   │ +│   (47)   0.0   │ +│   (48)   0.0   │ +│   (49)   0.0   │ +│   (50)   0.0   │ +│     ⋮   │ +│   │ +│ │ +╰────── 200 items ───╯ diff --git a/test/txtfiles/termshow_6.txt b/test/txtfiles/termshow_6.txt index b4b07ee13..263354f9e 100644 --- a/test/txtfiles/termshow_6.txt +++ b/test/txtfiles/termshow_6.txt @@ -1,37 +1,37 @@ -╭──── Array {Float64, 3}  ────────╮ -│ │ -│ ╭─────────────────────────────╮ │ -│ │   │ │ -│ │     (1)   (2)   (3)   │ │ -│ │   │ │ -│ │   (1)   0.0   0.0   0.0   │ │ -│ │   (2)   0.0   0.0   0.0   │ │ -│ │   (3)   0.0   0.0   0.0   │ │ -│ │   │ │ -│ ╰─────────────── [:, :, 1] ───╯ │ -│ │ -│ │ -│ ╭─────────────────────────────╮ │ -│ │   │ │ -│ │     (1)   (2)   (3)   │ │ -│ │   │ │ -│ │   (1)   0.0   0.0   0.0   │ │ -│ │   (2)   0.0   0.0   0.0   │ │ -│ │   (3)   0.0   0.0   0.0   │ │ -│ │   │ │ -│ ╰─────────────── [:, :, 2] ───╯ │ -│ │ -│ │ -│ ╭─────────────────────────────╮ │ -│ │   │ │ -│ │     (1)   (2)   (3)   │ │ -│ │   │ │ -│ │   (1)   0.0   0.0   0.0   │ │ -│ │   (2)   0.0   0.0   0.0   │ │ -│ │   (3)   0.0   0.0   0.0   │ │ -│ │   │ │ -│ ╰─────────────── [:, :, 3] ───╯ │ -│ │ -│ │ -│ │ -╰─────────────────── 3 × 3 × 3 ───╯ +╭──── Array {Float64, 3}  ────────╮ +│ │ +│ ╭─────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   │ │ +│ │   (2)   0.0   0.0   0.0   │ │ +│ │   (3)   0.0   0.0   0.0   │ │ +│ │   │ │ +│ ╰─────────────── [:, :, 1] ───╯ │ +│ │ +│ │ +│ ╭─────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   │ │ +│ │   (2)   0.0   0.0   0.0   │ │ +│ │   (3)   0.0   0.0   0.0   │ │ +│ │   │ │ +│ ╰─────────────── [:, :, 2] ───╯ │ +│ │ +│ │ +│ ╭─────────────────────────────╮ │ +│ │   │ │ +│ │     (1)   (2)   (3)   │ │ +│ │   │ │ +│ │   (1)   0.0   0.0   0.0   │ │ +│ │   (2)   0.0   0.0   0.0   │ │ +│ │   (3)   0.0   0.0   0.0   │ │ +│ │   │ │ +│ ╰─────────────── [:, :, 3] ───╯ │ +│ │ +│ │ +│ │ +╰─────────────────── 3 × 3 × 3 ───╯ diff --git a/test/txtfiles/termshow_7.txt b/test/txtfiles/termshow_7.txt index 050aa42cf..4781691dc 100644 --- a/test/txtfiles/termshow_7.txt +++ b/test/txtfiles/termshow_7.txt @@ -1,12 +1,12 @@ - ╭──── Function: clear ─────────────────────────────╮ - │ │ - │ (1)  clear() │ - │ (2)  clear(io::IO) │ - │ │ - ╰──────────────────────────────────── 2 methods ───╯ -━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━ - ┌─────────────────────────────────────┐ - │ clear(io::IO = stdout)  │ - └─────────────────────────────────────┘ + ╭──── Function: clear ─────────────────────────────╮ + │ │ + │ (1)  clear() │ + │ (2)  clear(io::IO) │ + │ │ + ╰──────────────────────────────────── 2 methods ───╯ +━━━━━━━━━━━━━━━━━━━━━━ Docstring ━━━━━━━━━━━━━━━━━━━━━━ + ┌─────────────────────────────────────┐ + │ clear(io::IO = stdout)  │ + └─────────────────────────────────────┘ Clear terminal from anything printed in the REPL. diff --git a/test/txtfiles/termshow_8.txt b/test/txtfiles/termshow_8.txt index de2f5872e..47daba0a8 100644 --- a/test/txtfiles/termshow_8.txt +++ b/test/txtfiles/termshow_8.txt @@ -1,6 +1,6 @@ -╭──────────────────────────────────────────╮ -│ x / y + √9 │ -│ ────────────────────────────────────── │ -│ head::Symbol│ call │ -│ args::Vector│ Any[:+, :(x / y), :(√9)] │ -╰───────────────────────────────── Expr ───╯ +╭──────────────────────────────────────────╮ +│ x / y + √9 │ +│ ────────────────────────────────────── │ +│ head::Symbol│ call │ +│ args::Vector│ Any[:+, :(x / y), :(√9)] │ +╰───────────────────────────────── Expr ───╯ diff --git a/test/txtfiles/termshow_9.txt b/test/txtfiles/termshow_9.txt index 319017b4c..66139479b 100644 --- a/test/txtfiles/termshow_9.txt +++ b/test/txtfiles/termshow_9.txt @@ -1,15 +1,15 @@ -╭────────────────────╮ -│ │ -│   (1)   0.0   │ -│   (2)   0.0   │ -│   (3)   0.0   │ -│   (4)   0.0   │ -│   (5)   0.0   │ -│   (6)   0.0   │ -│   (7)   0.0   │ -│   (8)   0.0   │ -│   (9)   0.0   │ -│   (10)   0.0   │ -│   │ -│ │ -╰─────── 10 items ───╯ +╭────────────────────╮ +│ │ +│   (1)   0.0   │ +│   (2)   0.0   │ +│   (3)   0.0   │ +│   (4)   0.0   │ +│   (5)   0.0   │ +│   (6)   0.0   │ +│   (7)   0.0   │ +│   (8)   0.0   │ +│   (9)   0.0   │ +│   (10)   0.0   │ +│   │ +│ │ +╰─────── 10 items ───╯ diff --git a/test/txtfiles/tree_1.txt b/test/txtfiles/tree_1.txt index b71b10471..fdd3dadda 100644 --- a/test/txtfiles/tree_1.txt +++ b/test/txtfiles/tree_1.txt @@ -1,6 +1,6 @@ tree ━━━━━━ │  - └── nestedasdasdsadasdasdsadsadasdasdasdsadas... + └── nestedasdasdsadasdasdsadsadasdasdasdsadas...  ├── n1: 1  └── n2: 2 \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_1.txt b/test/txtfiles/tree_1_1_1.txt new file mode 100644 index 000000000..93dcdd555 --- /dev/null +++ b/test/txtfiles/tree_1_1_1.txt @@ -0,0 +1,8 @@ +tree_1_1_1 + └─ nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfdsfsd +fd ⇒ Dict("n1" => 1, "n2" => 2) + + ├─ n1 ⇒ 1 + + └─ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_10.txt b/test/txtfiles/tree_1_1_10.txt new file mode 100644 index 000000000..f5bf6e25f --- /dev/null +++ b/test/txtfiles/tree_1_1_10.txt @@ -0,0 +1,2 @@ +tree_1_1_10 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_11.txt b/test/txtfiles/tree_1_1_11.txt new file mode 100644 index 000000000..83afd1386 --- /dev/null +++ b/test/txtfiles/tree_1_1_11.txt @@ -0,0 +1,2 @@ +tree_1_1_11 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_12.txt b/test/txtfiles/tree_1_1_12.txt new file mode 100644 index 000000000..bfe0c9f96 --- /dev/null +++ b/test/txtfiles/tree_1_1_12.txt @@ -0,0 +1,7 @@ +tree_1_1_12 + ├─ 1 ⇒ print + └─ 2 ⇒ :((x, y)) + └─ 1 ⇒ (x, y) + ├─ 1 ⇒ x + └─ 2 ⇒ y + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_2.txt b/test/txtfiles/tree_1_1_2.txt new file mode 100644 index 000000000..77f2bff56 --- /dev/null +++ b/test/txtfiles/tree_1_1_2.txt @@ -0,0 +1,8 @@ +tree_1_1_2 + ├─ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + │ ├─ n1 ⇒ a + │ └─ n2 ⇒ 2 + └─ nested ⇒ Dict("n1" => 1, "n2" => 2) + ├─ n1 ⇒ 1 + └─ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_3.txt b/test/txtfiles/tree_1_1_3.txt new file mode 100644 index 000000000..f6ee913af --- /dev/null +++ b/test/txtfiles/tree_1_1_3.txt @@ -0,0 +1,10 @@ +tree_1_1_3 + ├─ leaf ⇒ 2 + ├─ nested ⇒ Dict("n1" => 1, "n2" => 2) + │ ├─ n1 ⇒ 1 + │ └─ n2 ⇒ 2 + ├─ canopy ⇒ test + ├─ leafme ⇒ v + ├─ ["a"] ⇒ test + └─ leaf2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_4.txt b/test/txtfiles/tree_1_1_4.txt new file mode 100644 index 000000000..f33e67e18 --- /dev/null +++ b/test/txtfiles/tree_1_1_4.txt @@ -0,0 +1,23 @@ +tree_1_1_4 + ├─ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + │ ├─ n1 ⇒ a + │ └─ n2 ⇒ 2 + └─ nested ⇒ Dict("n3" => 3, "n2" => Int64, "deeper" + => Dict("aleaf" => "unbeliefable", "leaflet" +  => "level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3")) + ├─ n3 ⇒ 3 + ├─ n2 ⇒ Int64 + └─ deeper ⇒ Dict("aleaf" => "unbeliefable", "leaflet" + => "level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3") + ├─ aleaf ⇒ unbeliefable + └─ leaflet ⇒ level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_5.txt b/test/txtfiles/tree_1_1_5.txt new file mode 100644 index 000000000..effe7a727 --- /dev/null +++ b/test/txtfiles/tree_1_1_5.txt @@ -0,0 +1,20 @@ +tree_1_1_5 + ├─ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + │ ├─ n1 ⇒ a + │ └─ n2 ⇒ 2 + └─ nested ⇒ Dict("adict" => Dict("x" => 2), "n3" => + 3, "n2" => Int64, "deeper" => Dict("sodeep" + => Dict("a" => 4), "aleaf" => "unbeliefable" + , "leaflet" => "level 3")) + ├─ adict ⇒ Dict("x" => 2) + │ └─ x ⇒ 2 + ├─ n3 ⇒ 3 + ├─ n2 ⇒ Int64 + └─ deeper ⇒ Dict("sodeep" => Dict("a" => 4), "aleaf" + => "unbeliefable", "leaflet" => "level + 3") + ├─ sodeep ⇒ Dict("a" => 4) + │ └─ a ⇒ 4 + ├─ aleaf ⇒ unbeliefable + └─ leaflet ⇒ level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_6.txt b/test/txtfiles/tree_1_1_6.txt new file mode 100644 index 000000000..bcd581e54 --- /dev/null +++ b/test/txtfiles/tree_1_1_6.txt @@ -0,0 +1,8 @@ +tree_1_1_6 + ├─ 3 [39m⇒ OrderedDict(3 => 8, 1 => "a") + │ ├─ 3 ⇒ 8 + │ └─ 1 ⇒ a + └─ 2 ⇒ OrderedDict(3 => 8, 1 => "a") + ├─ 3 ⇒ 8 + └─ 1 ⇒ a + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_7.txt b/test/txtfiles/tree_1_1_7.txt new file mode 100644 index 000000000..1b3f43f35 --- /dev/null +++ b/test/txtfiles/tree_1_1_7.txt @@ -0,0 +1,7 @@ +tree_1_1_7 + ├─ 2 ⇒ 1 + └─ 3 ⇒ OrderedDict(4 => 2, "a" => 2, "b" => 1) + ├─ 4 ⇒ 2 + ├─ a ⇒ 2 + └─ b ⇒ 1 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_8.txt b/test/txtfiles/tree_1_1_8.txt new file mode 100644 index 000000000..8c8a16179 --- /dev/null +++ b/test/txtfiles/tree_1_1_8.txt @@ -0,0 +1,8 @@ +tree_1_1_8 + ├─ 1 ⇒ 1 + ├─ 2 ⇒ 2 + └─ 3 ⇒ [2, 3, 4] + ├─ 1 ⇒ 2 + ├─ 2 ⇒ 3 + └─ 3 ⇒ 4 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_1_9.txt b/test/txtfiles/tree_1_1_9.txt new file mode 100644 index 000000000..40d610988 --- /dev/null +++ b/test/txtfiles/tree_1_1_9.txt @@ -0,0 +1,26 @@ +tree_1_1_9 + ├─ 1 ⇒ 1 + ├─ 2 ⇒ Any[2, [3, 4], "aaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + │ ├─ 1 ⇒ 2 + │ ├─ 2 ⇒ [3, 4] + │ │ ├─ 1 ⇒ 3 + │ │ └─ 2 ⇒ 4 + │ └─ 3 ⇒ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaa + ├─ 3 ⇒ c + └─ 4 ⇒ OrderedDict(2 => "a", 1 => :ok, "a" => + 2, :test => [1, 2]) + ├─ 2 ⇒ a + ├─ 1 ⇒ ok + ├─ a ⇒ 2 + └─ test ⇒ [1, 2] + ├─ 1 ⇒ 1 + └─ 2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_1.txt b/test/txtfiles/tree_1_2_1.txt new file mode 100644 index 000000000..13a36ceb8 --- /dev/null +++ b/test/txtfiles/tree_1_2_1.txt @@ -0,0 +1,8 @@ +tree_1_2_1 + ┗━━━ nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfdsf +sdfd ⇒ Dict("n1" => 1, "n2" => 2) + + ┣━━━ n1 ⇒ 1 + + ┗━━━ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_10.txt b/test/txtfiles/tree_1_2_10.txt new file mode 100644 index 000000000..a5f31393d --- /dev/null +++ b/test/txtfiles/tree_1_2_10.txt @@ -0,0 +1,2 @@ +tree_1_2_10 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_11.txt b/test/txtfiles/tree_1_2_11.txt new file mode 100644 index 000000000..ee47dd3fa --- /dev/null +++ b/test/txtfiles/tree_1_2_11.txt @@ -0,0 +1,2 @@ +tree_1_2_11 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_12.txt b/test/txtfiles/tree_1_2_12.txt new file mode 100644 index 000000000..37fcb5658 --- /dev/null +++ b/test/txtfiles/tree_1_2_12.txt @@ -0,0 +1,7 @@ +tree_1_2_12 + ┣━━━ 1 ⇒ print + ┗━━━ 2 ⇒ :((x, y)) + ┗━━━ 1 ⇒ (x, y) + ┣━━━ 1 ⇒ x + ┗━━━ 2 ⇒ y + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_2.txt b/test/txtfiles/tree_1_2_2.txt new file mode 100644 index 000000000..bf56c0341 --- /dev/null +++ b/test/txtfiles/tree_1_2_2.txt @@ -0,0 +1,8 @@ +tree_1_2_2 + ┣━━━ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + ┃ ┣━━━ n1 ⇒ a + ┃ ┗━━━ n2 ⇒ 2 + ┗━━━ nested ⇒ Dict("n1" => 1, "n2" => 2) + ┣━━━ n1 ⇒ 1 + ┗━━━ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_3.txt b/test/txtfiles/tree_1_2_3.txt new file mode 100644 index 000000000..014756f6a --- /dev/null +++ b/test/txtfiles/tree_1_2_3.txt @@ -0,0 +1,10 @@ +tree_1_2_3 + ┣━━━ leaf ⇒ 2 + ┣━━━ nested ⇒ Dict("n1" => 1, "n2" => 2) + ┃ ┣━━━ n1 ⇒ 1 + ┃ ┗━━━ n2 ⇒ 2 + ┣━━━ canopy ⇒ test + ┣━━━ leafme ⇒ v + ┣━━━ ["a"] ⇒ test + ┗━━━ leaf2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_4.txt b/test/txtfiles/tree_1_2_4.txt new file mode 100644 index 000000000..a4909ef89 --- /dev/null +++ b/test/txtfiles/tree_1_2_4.txt @@ -0,0 +1,26 @@ +tree_1_2_4 + ┣━━━ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + ┃ ┣━━━ n1 ⇒ a + ┃ ┗━━━ n2 ⇒ 2 + ┗━━━ nested ⇒ Dict("n3" => 3, "n2" => Int64, "deeper" + => Dict("aleaf" => "unbeliefable", "leaflet" +  => "level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3")) + ┣━━━ n3 ⇒ 3 + ┣━━━ n2 ⇒ Int64 + ┗━━━ deeper ⇒ Dict("aleaf" => "unbeliefable", "leaflet" + => "level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3") + ┣━━━ aleaf ⇒ unbeliefable + ┗━━━ leaflet ⇒ level 3level 3level 3level 3level +3level + 3level 3level 3level 3level 3level +3level + 3level 3level 3level 3level 3level +3level + 3level 3level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_5.txt b/test/txtfiles/tree_1_2_5.txt new file mode 100644 index 000000000..74f585aad --- /dev/null +++ b/test/txtfiles/tree_1_2_5.txt @@ -0,0 +1,20 @@ +tree_1_2_5 + ┣━━━ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + ┃ ┣━━━ n1 ⇒ a + ┃ ┗━━━ n2 ⇒ 2 + ┗━━━ nested ⇒ Dict("adict" => Dict("x" => 2), "n3" => + 3, "n2" => Int64, "deeper" => Dict("sodeep" + => Dict("a" => 4), "aleaf" => "unbeliefable" + , "leaflet" => "level 3")) + ┣━━━ adict ⇒ Dict("x" => 2) + ┃ ┗━━━ x ⇒ 2 + ┣━━━ n3 ⇒ 3 + ┣━━━ n2 ⇒ Int64 + ┗━━━ deeper ⇒ Dict("sodeep" => Dict("a" => 4), "aleaf" + => "unbeliefable", "leaflet" => "level + 3") + ┣━━━ sodeep ⇒ Dict("a" => 4) + ┃ ┗━━━ a ⇒ 4 + ┣━━━ aleaf ⇒ unbeliefable + ┗━━━ leaflet ⇒ level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_6.txt b/test/txtfiles/tree_1_2_6.txt new file mode 100644 index 000000000..8960b3f73 --- /dev/null +++ b/test/txtfiles/tree_1_2_6.txt @@ -0,0 +1,8 @@ +tree_1_2_6 + ┣━━━ 3 ⇒ OrderedDict(3 => 8, 1 => "a") + ┃ ┣━━━ 3 ⇒ 8 + ┃ ┗━━━ 1 ⇒ a + ┗━━━ 2 ⇒ OrderedDict(3 => 8, 1 => "a") + ┣━━━ 3 ⇒ 8 + ┗━━━ 1 ⇒ a + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_7.txt b/test/txtfiles/tree_1_2_7.txt new file mode 100644 index 000000000..8da64001c --- /dev/null +++ b/test/txtfiles/tree_1_2_7.txt @@ -0,0 +1,7 @@ +tree_1_2_7 + ┣━━━ 2 ⇒ 1 + ┗━━━ 3 ⇒ OrderedDict(4 => 2, "a" => 2, "b" => 1) + ┣━━━ 4 ⇒ 2 + ┣━━━ a ⇒ 2 + ┗━━━ b ⇒ 1 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_8.txt b/test/txtfiles/tree_1_2_8.txt new file mode 100644 index 000000000..b39843cad --- /dev/null +++ b/test/txtfiles/tree_1_2_8.txt @@ -0,0 +1,8 @@ +tree_1_2_8 + ┣━━━ 1 ⇒ 1 + ┣━━━ 2 ⇒ 2 + ┗━━━ 3 ⇒ [2, 3, 4] + ┣━━━ 1 ⇒ 2 + ┣━━━ 2 ⇒ 3 + ┗━━━ 3 ⇒ 4 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_2_9.txt b/test/txtfiles/tree_1_2_9.txt new file mode 100644 index 000000000..73dbdd289 --- /dev/null +++ b/test/txtfiles/tree_1_2_9.txt @@ -0,0 +1,26 @@ +tree_1_2_9 + ┣━━━ 1 ⇒ 1 + ┣━━━ 2 ⇒ Any[2, [3, 4], "aaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + ┃ ┣━━━ 1 ⇒ 2 + ┃ ┣━━━ 2 ⇒ [3, 4] + ┃ ┃ ┣━━━ 1 ⇒ 3 + ┃ ┃ ┗━━━ 2 ⇒ 4 + ┃ ┗━━━ 3 ⇒ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaa + ┣━━━ 3 ⇒ c + ┗━━━ 4 ⇒ OrderedDict(2 => "a", 1 => :ok, "a" => + 2, :test => [1, 2]) + ┣━━━ 2 ⇒ a + ┣━━━ 1 ⇒ ok + ┣━━━ a ⇒ 2 + ┗━━━ test ⇒ [1, 2] + ┣━━━ 1 ⇒ 1 + ┗━━━ 2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_1.txt b/test/txtfiles/tree_1_3_1.txt new file mode 100644 index 000000000..52b2cb9c9 --- /dev/null +++ b/test/txtfiles/tree_1_3_1.txt @@ -0,0 +1,8 @@ +tree_1_3_1 + `---- nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfds +fsdfd => Dict("n1" => 1, "n2" => 2) + + +---- n1 => 1 + + `---- n2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_10.txt b/test/txtfiles/tree_1_3_10.txt new file mode 100644 index 000000000..3f0f30fee --- /dev/null +++ b/test/txtfiles/tree_1_3_10.txt @@ -0,0 +1,2 @@ +tree_1_3_10 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_11.txt b/test/txtfiles/tree_1_3_11.txt new file mode 100644 index 000000000..3c2d36419 --- /dev/null +++ b/test/txtfiles/tree_1_3_11.txt @@ -0,0 +1,2 @@ +tree_1_3_11 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_12.txt b/test/txtfiles/tree_1_3_12.txt new file mode 100644 index 000000000..8a6107628 --- /dev/null +++ b/test/txtfiles/tree_1_3_12.txt @@ -0,0 +1,7 @@ +tree_1_3_12 + +---- 1 => print + `---- 2 => :((x, y)) + `---- 1 => (x, y) + +---- 1 => x + `---- 2 => y + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_2.txt b/test/txtfiles/tree_1_3_2.txt new file mode 100644 index 000000000..a4e3f9040 --- /dev/null +++ b/test/txtfiles/tree_1_3_2.txt @@ -0,0 +1,8 @@ +tree_1_3_2 + +---- nested2 => Dict("n1" => "a", "n2" => 2) + | +---- n1 => a + | `---- n2 => 2 + `---- nested => Dict("n1" => 1, "n2" => 2) + +---- n1 => 1 + `---- n2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_3.txt b/test/txtfiles/tree_1_3_3.txt new file mode 100644 index 000000000..6c6c3af93 --- /dev/null +++ b/test/txtfiles/tree_1_3_3.txt @@ -0,0 +1,10 @@ +tree_1_3_3 + +---- leaf => 2 + +---- nested => Dict("n1" => 1, "n2" => 2) + | +---- n1 => 1 + | `---- n2 => 2 + +---- canopy => test + +---- leafme => v + +---- ["a"] => test + `---- leaf2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_4.txt b/test/txtfiles/tree_1_3_4.txt new file mode 100644 index 000000000..ce22da3cb --- /dev/null +++ b/test/txtfiles/tree_1_3_4.txt @@ -0,0 +1,26 @@ +tree_1_3_4 + +---- nested2 => Dict("n1" => "a", "n2" => 2) + | +---- n1 => a + | `---- n2 => 2 + `---- nested => Dict("n3" => 3, "n2" => Int64, "deeper" + => Dict("aleaf" => "unbeliefable", "leaflet" +  => "level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3")) + +---- n3 => 3 + +---- n2 => Int64 + `---- deeper => Dict("aleaf" => "unbeliefable", "leaflet" + => "level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3") + +---- aleaf => unbeliefable + `---- leaflet => level 3level 3level 3level +3level 3level + 3level 3level 3level 3level 3level + 3level + 3level 3level 3level 3level 3level + 3level + 3level 3level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_5.txt b/test/txtfiles/tree_1_3_5.txt new file mode 100644 index 000000000..c0de41189 --- /dev/null +++ b/test/txtfiles/tree_1_3_5.txt @@ -0,0 +1,20 @@ +tree_1_3_5 + +---- nested2 => Dict("n1" => "a", "n2" => 2) + | +---- n1 => a + | `---- n2 => 2 + `---- nested => Dict("adict" => Dict("x" => 2), "n3" => + 3, "n2" => Int64, "deeper" => Dict("sodeep" + => Dict("a" => 4), "aleaf" => "unbeliefable" + , "leaflet" => "level 3")) + +---- adict => Dict("x" => 2) + | `---- x => 2 + +---- n3 => 3 + +---- n2 => Int64 + `---- deeper => Dict("sodeep" => Dict("a" => 4), "aleaf" + => "unbeliefable", "leaflet" => "level + 3") + +---- sodeep => Dict("a" => 4) + | `---- a => 4 + +---- aleaf => unbeliefable + `---- leaflet => level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_6.txt b/test/txtfiles/tree_1_3_6.txt new file mode 100644 index 000000000..f5e4b4ecc --- /dev/null +++ b/test/txtfiles/tree_1_3_6.txt @@ -0,0 +1,8 @@ +tree_1_3_6 + +---- 3 => OrderedDict(3 => 8, 1 => "a") + | +---- 3 => 8 + | `---- 1 => a + `---- 2 => OrderedDict(3 => 8, 1 => "a") + +---- 3 => 8 + `---- 1 => a + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_7.txt b/test/txtfiles/tree_1_3_7.txt new file mode 100644 index 000000000..2bff133f2 --- /dev/null +++ b/test/txtfiles/tree_1_3_7.txt @@ -0,0 +1,7 @@ +tree_1_3_7 + +---- 2 => 1 + `---- 3 => OrderedDict(4 => 2, "a" => 2, "b" => 1) + +---- 4 => 2 + +---- a => 2 + `---- b => 1 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_8.txt b/test/txtfiles/tree_1_3_8.txt new file mode 100644 index 000000000..5f1d16cb4 --- /dev/null +++ b/test/txtfiles/tree_1_3_8.txt @@ -0,0 +1,8 @@ +tree_1_3_8 + +---- 1 => 1 + +---- 2 => 2 + `---- 3 => [2, 3, 4] + +---- 1 => 2 + +---- 2 => 3 + `---- 3 => 4 + \ No newline at end of file diff --git a/test/txtfiles/tree_1_3_9.txt b/test/txtfiles/tree_1_3_9.txt new file mode 100644 index 000000000..d078d9fbe --- /dev/null +++ b/test/txtfiles/tree_1_3_9.txt @@ -0,0 +1,26 @@ +tree_1_3_9 + +---- 1 => 1 + +---- 2 => Any[2, [3, 4], "aaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + | +---- 1 => 2 + | +---- 2 => [3, 4] + | | +---- 1 => 3 + | | `---- 2 => 4 + | `---- 3 => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaa + +---- 3 => c + `---- 4 => OrderedDict(2 => "a", 1 => :ok, "a" => + 2, :test => [1, 2]) + +---- 2 => a + +---- 1 => ok + +---- a => 2 + `---- test => [1, 2] + +---- 1 => 1 + `---- 2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_1.txt b/test/txtfiles/tree_2_1_1.txt new file mode 100644 index 000000000..387e503f8 --- /dev/null +++ b/test/txtfiles/tree_2_1_1.txt @@ -0,0 +1,8 @@ +tree_2_1_1 + └─ nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfdsfsd +fd ⇒ Dict("n1" => 1, "n2" => 2) + + ├─ n1 ⇒ 1 + + └─ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_10.txt b/test/txtfiles/tree_2_1_10.txt new file mode 100644 index 000000000..ce609ca06 --- /dev/null +++ b/test/txtfiles/tree_2_1_10.txt @@ -0,0 +1,2 @@ +tree_2_1_10 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_11.txt b/test/txtfiles/tree_2_1_11.txt new file mode 100644 index 000000000..577ba2be9 --- /dev/null +++ b/test/txtfiles/tree_2_1_11.txt @@ -0,0 +1,2 @@ +tree_2_1_11 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_12.txt b/test/txtfiles/tree_2_1_12.txt new file mode 100644 index 000000000..5b6e8c91a --- /dev/null +++ b/test/txtfiles/tree_2_1_12.txt @@ -0,0 +1,7 @@ +tree_2_1_12 + ├─ 1 ⇒ print + └─ 2 ⇒ :((x, y)) + └─ 1 ⇒ (x, y) + ├─ 1 ⇒ x + └─ 2 ⇒ y + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_2.txt b/test/txtfiles/tree_2_1_2.txt new file mode 100644 index 000000000..487b51f45 --- /dev/null +++ b/test/txtfiles/tree_2_1_2.txt @@ -0,0 +1,8 @@ +tree_2_1_2 + ├─ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + │ ├─ n1 ⇒ a + │ └─ n2 ⇒ 2 + └─ nested ⇒ Dict("n1" => 1, "n2" => 2) + ├─ n1 ⇒ 1 + └─ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_3.txt b/test/txtfiles/tree_2_1_3.txt new file mode 100644 index 000000000..2834e0586 --- /dev/null +++ b/test/txtfiles/tree_2_1_3.txt @@ -0,0 +1,10 @@ +tree_2_1_3 + ├─ leaf ⇒ 2 + ├─ nested ⇒ Dict("n1" => 1, "n2" => 2) + │ ├─ n1 ⇒ 1 + │ └─ n2 ⇒ 2 + ├─ canopy ⇒ test + ├─ leafme ⇒ v + ├─ ["a"] ⇒ test + └─ leaf2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_4.txt b/test/txtfiles/tree_2_1_4.txt new file mode 100644 index 000000000..fa1a3c155 --- /dev/null +++ b/test/txtfiles/tree_2_1_4.txt @@ -0,0 +1,23 @@ +tree_2_1_4 + ├─ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + │ ├─ n1 ⇒ a + │ └─ n2 ⇒ 2 + └─ nested ⇒ Dict("n3" => 3, "n2" => Int64, "deeper" + => Dict("aleaf" => "unbeliefable", "leaflet" +  => "level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3")) + ├─ n3 ⇒ 3 + ├─ n2 ⇒ Int64 + └─ deeper ⇒ Dict("aleaf" => "unbeliefable", "leaflet" + => "level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3") + ├─ aleaf ⇒ unbeliefable + └─ leaflet ⇒ level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_5.txt b/test/txtfiles/tree_2_1_5.txt new file mode 100644 index 000000000..a908c3001 --- /dev/null +++ b/test/txtfiles/tree_2_1_5.txt @@ -0,0 +1,20 @@ +tree_2_1_5 + ├─ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + │ ├─ n1 ⇒ a + │ └─ n2 ⇒ 2 + └─ nested ⇒ Dict("adict" => Dict("x" => 2), "n3" => + 3, "n2" => Int64, "deeper" => Dict("sodeep" + => Dict("a" => 4), "aleaf" => "unbeliefable" + , "leaflet" => "level 3")) + ├─ adict ⇒ Dict("x" => 2) + │ └─ x ⇒ 2 + ├─ n3 ⇒ 3 + ├─ n2 ⇒ Int64 + └─ deeper ⇒ Dict("sodeep" => Dict("a" => 4), "aleaf" + => "unbeliefable", "leaflet" => "level + 3") + ├─ sodeep ⇒ Dict("a" => 4) + │ └─ a ⇒ 4 + ├─ aleaf ⇒ unbeliefable + └─ leaflet ⇒ level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_6.txt b/test/txtfiles/tree_2_1_6.txt new file mode 100644 index 000000000..f53661481 --- /dev/null +++ b/test/txtfiles/tree_2_1_6.txt @@ -0,0 +1,8 @@ +tree_2_1_6 + ├─ 3 ⇒ OrderedDict(3 => 8, 1 => "a") + │ ├─ 3 ⇒ 8 + │ └─ 1 ⇒ a + └─ 2 ⇒ OrderedDict(3 => 8, 1 => "a") + ├─ 3 ⇒ 8 + └─ 1 ⇒ a + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_7.txt b/test/txtfiles/tree_2_1_7.txt new file mode 100644 index 000000000..8a48eff58 --- /dev/null +++ b/test/txtfiles/tree_2_1_7.txt @@ -0,0 +1,7 @@ +tree_2_1_7 + ├─ 2 ⇒ 1 + └─ 3 ⇒ OrderedDict(4 => 2, "a" => 2, "b" => 1) + ├─ 4 ⇒ 2 + ├─ a ⇒ 2 + └─ b ⇒ 1 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_8.txt b/test/txtfiles/tree_2_1_8.txt new file mode 100644 index 000000000..ca3c49e91 --- /dev/null +++ b/test/txtfiles/tree_2_1_8.txt @@ -0,0 +1,8 @@ +tree_2_1_8 + ├─ 1 ⇒ 1 + ├─ 2 ⇒ 2 + └─ 3 ⇒ [2, 3, 4] + ├─ 1 ⇒ 2 + ├─ 2 ⇒ 3 + └─ 3 ⇒ 4 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_1_9.txt b/test/txtfiles/tree_2_1_9.txt new file mode 100644 index 000000000..cb38525ce --- /dev/null +++ b/test/txtfiles/tree_2_1_9.txt @@ -0,0 +1,26 @@ +tree_2_1_9 + ├─ 1 ⇒ 1 + ├─ 2 ⇒ Any[2, [3, 4], "aaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + │ ├─ 1 ⇒ 2 + │ ├─ 2 ⇒ [3, 4] + │ │ ├─ 1 ⇒ 3 + │ │ └─ 2 ⇒ 4 + │ └─ 3 ⇒ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + │ aaaaaaaaaaaaaaaaaaaaaaaa + ├─ 3 ⇒ c + └─ 4 ⇒ OrderedDict(2 => "a", 1 => :ok, "a" => + 2, :test => [1, 2]) + ├─ 2 ⇒ a + ├─ 1 ⇒ ok + ├─ a ⇒ 2 + └─ test ⇒ [1, 2] + ├─ 1 ⇒ 1 + └─ 2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_1.txt b/test/txtfiles/tree_2_2_1.txt new file mode 100644 index 000000000..c4bdf7203 --- /dev/null +++ b/test/txtfiles/tree_2_2_1.txt @@ -0,0 +1,8 @@ +tree_2_2_1 + ┗━━━ nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfdsf +sdfd ⇒ Dict("n1" => 1, "n2" => 2) + + ┣━━━ n1 ⇒ 1 + + ┗━━━ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_10.txt b/test/txtfiles/tree_2_2_10.txt new file mode 100644 index 000000000..14879efe5 --- /dev/null +++ b/test/txtfiles/tree_2_2_10.txt @@ -0,0 +1,2 @@ +tree_2_2_10 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_11.txt b/test/txtfiles/tree_2_2_11.txt new file mode 100644 index 000000000..40b3c6da1 --- /dev/null +++ b/test/txtfiles/tree_2_2_11.txt @@ -0,0 +1,2 @@ +tree_2_2_11 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_12.txt b/test/txtfiles/tree_2_2_12.txt new file mode 100644 index 000000000..bd4e590e4 --- /dev/null +++ b/test/txtfiles/tree_2_2_12.txt @@ -0,0 +1,7 @@ +tree_2_2_12 + ┣━━━ 1 ⇒ print + ┗━━━ 2 ⇒ :((x, y)) + ┗━━━ 1 ⇒ (x, y) + ┣━━━ 1 ⇒ x + ┗━━━ 2 ⇒ y + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_2.txt b/test/txtfiles/tree_2_2_2.txt new file mode 100644 index 000000000..1a1f44634 --- /dev/null +++ b/test/txtfiles/tree_2_2_2.txt @@ -0,0 +1,8 @@ +tree_2_2_2 + ┣━━━ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + ┃ ┣━━━ n1 ⇒ a + ┃ ┗━━━ n2 ⇒ 2 + ┗━━━ nested ⇒ Dict("n1" => 1, "n2" => 2) + ┣━━━ n1 ⇒ 1 + ┗━━━ n2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_3.txt b/test/txtfiles/tree_2_2_3.txt new file mode 100644 index 000000000..0a3a4acc4 --- /dev/null +++ b/test/txtfiles/tree_2_2_3.txt @@ -0,0 +1,10 @@ +tree_2_2_3 + ┣━━━ leaf ⇒ 2 + ┣━━━ nested ⇒ Dict("n1" => 1, "n2" => 2) + ┃ ┣━━━ n1 ⇒ 1 + ┃ ┗━━━ n2 ⇒ 2 + ┣━━━ canopy ⇒ test + ┣━━━ leafme ⇒ v + ┣━━━ ["a"] ⇒ test + ┗━━━ leaf2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_4.txt b/test/txtfiles/tree_2_2_4.txt new file mode 100644 index 000000000..cedf1f448 --- /dev/null +++ b/test/txtfiles/tree_2_2_4.txt @@ -0,0 +1,26 @@ +tree_2_2_4 + ┣━━━ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + ┃ ┣━━━ n1 ⇒ a + ┃ ┗━━━ n2 ⇒ 2 + ┗━━━ nested ⇒ Dict("n3" => 3, "n2" => Int64, "deeper" + => Dict("aleaf" => "unbeliefable", "leaflet" +  => "level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3")) + ┣━━━ n3 ⇒ 3 + ┣━━━ n2 ⇒ Int64 + ┗━━━ deeper ⇒ Dict("aleaf" => "unbeliefable", "leaflet" + => "level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3") + ┣━━━ aleaf ⇒ unbeliefable + ┗━━━ leaflet ⇒ level 3level 3level 3level 3level +3level + 3level 3level 3level 3level 3level +3level + 3level 3level 3level 3level 3level +3level + 3level 3level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_5.txt b/test/txtfiles/tree_2_2_5.txt new file mode 100644 index 000000000..b1b5987f3 --- /dev/null +++ b/test/txtfiles/tree_2_2_5.txt @@ -0,0 +1,20 @@ +tree_2_2_5 + ┣━━━ nested2 ⇒ Dict("n1" => "a", "n2" => 2) + ┃ ┣━━━ n1 ⇒ a + ┃ ┗━━━ n2 ⇒ 2 + ┗━━━ nested ⇒ Dict("adict" => Dict("x" => 2), "n3" => + 3, "n2" => Int64, "deeper" => Dict("sodeep" + => Dict("a" => 4), "aleaf" => "unbeliefable" + , "leaflet" => "level 3")) + ┣━━━ adict ⇒ Dict("x" => 2) + ┃ ┗━━━ x ⇒ 2 + ┣━━━ n3 ⇒ 3 + ┣━━━ n2 ⇒ Int64 + ┗━━━ deeper ⇒ Dict("sodeep" => Dict("a" => 4), "aleaf" + => "unbeliefable", "leaflet" => "level + 3") + ┣━━━ sodeep ⇒ Dict("a" => 4) + ┃ ┗━━━ a ⇒ 4 + ┣━━━ aleaf ⇒ unbeliefable + ┗━━━ leaflet ⇒ level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_6.txt b/test/txtfiles/tree_2_2_6.txt new file mode 100644 index 000000000..dbc3dda48 --- /dev/null +++ b/test/txtfiles/tree_2_2_6.txt @@ -0,0 +1,8 @@ +tree_2_2_6 + ┣━━━ 3 ⇒ OrderedDict(3 => 8, 1 => "a") + ┃ ┣━━━ 3 ⇒ 8 + ┃ ┗━━━ 1 ⇒ a + ┗━━━ 2 ⇒ OrderedDict(3 => 8, 1 => "a") + ┣━━━ 3 ⇒ 8 + ┗━━━ 1 ⇒ a + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_7.txt b/test/txtfiles/tree_2_2_7.txt new file mode 100644 index 000000000..078b10205 --- /dev/null +++ b/test/txtfiles/tree_2_2_7.txt @@ -0,0 +1,7 @@ +tree_2_2_7 + ┣━━━ 2 ⇒ 1 + ┗━━━ 3 ⇒ OrderedDict(4 => 2, "a" => 2, "b" => 1) + ┣━━━ 4 ⇒ 2 + ┣━━━ a ⇒ 2 + ┗━━━ b ⇒ 1 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_8.txt b/test/txtfiles/tree_2_2_8.txt new file mode 100644 index 000000000..a90871991 --- /dev/null +++ b/test/txtfiles/tree_2_2_8.txt @@ -0,0 +1,8 @@ +tree_2_2_8 + ┣━━━ 1 ⇒ 1 + ┣━━━ 2 ⇒ 2 + ┗━━━ 3 ⇒ [2, 3, 4] + ┣━━━ 1 ⇒ 2 + ┣━━━ 2 ⇒ 3 + ┗━━━ 3 ⇒ 4 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_2_9.txt b/test/txtfiles/tree_2_2_9.txt new file mode 100644 index 000000000..7ce15be9b --- /dev/null +++ b/test/txtfiles/tree_2_2_9.txt @@ -0,0 +1,26 @@ +tree_2_2_9 + ┣━━━ 1 ⇒ 1 + ┣━━━ 2 ⇒ Any[2, [3, 4], "aaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + ┃ ┣━━━ 1 ⇒ 2 + ┃ ┣━━━ 2 ⇒ [3, 4] + ┃ ┃ ┣━━━ 1 ⇒ 3 + ┃ ┃ ┗━━━ 2 ⇒ 4 + ┃ ┗━━━ 3 ⇒ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ┃ aaaaaaaaaaaaaaaaaaaaaaaa + ┣━━━ 3 ⇒ c + ┗━━━ 4 ⇒ OrderedDict(2 => "a", 1 => :ok, "a" => + 2, :test => [1, 2]) + ┣━━━ 2 ⇒ a + ┣━━━ 1 ⇒ ok + ┣━━━ a ⇒ 2 + ┗━━━ test ⇒ [1, 2] + ┣━━━ 1 ⇒ 1 + ┗━━━ 2 ⇒ 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_1.txt b/test/txtfiles/tree_2_3_1.txt new file mode 100644 index 000000000..894c2b3a9 --- /dev/null +++ b/test/txtfiles/tree_2_3_1.txt @@ -0,0 +1,8 @@ +tree_2_3_1 + `---- nestedasdasdsadasdasdsadsadasdasdasdsadasasdasdassfsdfdsfdsfdsfsdfsdfds +fsdfd => Dict("n1" => 1, "n2" => 2) + + +---- n1 => 1 + + `---- n2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_10.txt b/test/txtfiles/tree_2_3_10.txt new file mode 100644 index 000000000..60e5b1377 --- /dev/null +++ b/test/txtfiles/tree_2_3_10.txt @@ -0,0 +1,2 @@ +tree_2_3_10 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_11.txt b/test/txtfiles/tree_2_3_11.txt new file mode 100644 index 000000000..42059bfb1 --- /dev/null +++ b/test/txtfiles/tree_2_3_11.txt @@ -0,0 +1,2 @@ +tree_2_3_11 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_12.txt b/test/txtfiles/tree_2_3_12.txt new file mode 100644 index 000000000..fc7041198 --- /dev/null +++ b/test/txtfiles/tree_2_3_12.txt @@ -0,0 +1,7 @@ +tree_2_3_12 + +---- 1 => print + `---- 2 => :((x, y)) + `---- 1 => (x, y) + +---- 1 => x + `---- 2 => y + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_2.txt b/test/txtfiles/tree_2_3_2.txt new file mode 100644 index 000000000..5a2a036c5 --- /dev/null +++ b/test/txtfiles/tree_2_3_2.txt @@ -0,0 +1,8 @@ +tree_2_3_2 + +---- nested2 => Dict("n1" => "a", "n2" => 2) + | +---- n1 => a + | `---- n2 => 2 + `---- nested => Dict("n1" => 1, "n2" => 2) + +---- n1 => 1 + `---- n2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_3.txt b/test/txtfiles/tree_2_3_3.txt new file mode 100644 index 000000000..6a6039f99 --- /dev/null +++ b/test/txtfiles/tree_2_3_3.txt @@ -0,0 +1,10 @@ +tree_2_3_3 + +---- leaf => 2 + +---- nested => Dict("n1" => 1, "n2" => 2) + | +---- n1 => 1 + | `---- n2 => 2 + +---- canopy => test + +---- leafme => v + +---- ["a"] => test + `---- leaf2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_4.txt b/test/txtfiles/tree_2_3_4.txt new file mode 100644 index 000000000..74e1e656b --- /dev/null +++ b/test/txtfiles/tree_2_3_4.txt @@ -0,0 +1,26 @@ +tree_2_3_4 + +---- nested2 => Dict("n1" => "a", "n2" => 2) + | +---- n1 => a + | `---- n2 => 2 + `---- nested => Dict("n3" => 3, "n2" => Int64, "deeper" + => Dict("aleaf" => "unbeliefable", "leaflet" +  => "level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3")) + +---- n3 => 3 + +---- n2 => Int64 + `---- deeper => Dict("aleaf" => "unbeliefable", "leaflet" + => "level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3level 3level 3level 3level + 3level 3level 3") + +---- aleaf => unbeliefable + `---- leaflet => level 3level 3level 3level +3level 3level + 3level 3level 3level 3level 3level + 3level + 3level 3level 3level 3level 3level + 3level + 3level 3level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_5.txt b/test/txtfiles/tree_2_3_5.txt new file mode 100644 index 000000000..c60e8b576 --- /dev/null +++ b/test/txtfiles/tree_2_3_5.txt @@ -0,0 +1,20 @@ +tree_2_3_5 + +---- nested2 => Dict("n1" => "a", "n2" => 2) + | +---- n1 => a + | `---- n2 => 2 + `---- nested => Dict("adict" => Dict("x" => 2), "n3" => + 3, "n2" => Int64, "deeper" => Dict("sodeep" + => Dict("a" => 4), "aleaf" => "unbeliefable" + , "leaflet" => "level 3")) + +---- adict => Dict("x" => 2) + | `---- x => 2 + +---- n3 => 3 + +---- n2 => Int64 + `---- deeper => Dict("sodeep" => Dict("a" => 4), "aleaf" + => "unbeliefable", "leaflet" => "level + 3") + +---- sodeep => Dict("a" => 4) + | `---- a => 4 + +---- aleaf => unbeliefable + `---- leaflet => level 3 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_6.txt b/test/txtfiles/tree_2_3_6.txt new file mode 100644 index 000000000..cb119689f --- /dev/null +++ b/test/txtfiles/tree_2_3_6.txt @@ -0,0 +1,8 @@ +tree_2_3_6 + +---- 3 => OrderedDict(3 => 8, 1 => "a") + | +---- 3 => 8 + | `---- 1 => a + `---- 2 => OrderedDict(3 => 8, 1 => "a") + +---- 3 => 8 + `---- 1 => a + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_7.txt b/test/txtfiles/tree_2_3_7.txt new file mode 100644 index 000000000..ba5ff5555 --- /dev/null +++ b/test/txtfiles/tree_2_3_7.txt @@ -0,0 +1,7 @@ +tree_2_3_7 + +---- 2 => 1 + `---- 3 => OrderedDict(4 => 2, "a" => 2, "b" => 1) + +---- 4 => 2 + +---- a => 2 + `---- b => 1 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_8.txt b/test/txtfiles/tree_2_3_8.txt new file mode 100644 index 000000000..20a8be710 --- /dev/null +++ b/test/txtfiles/tree_2_3_8.txt @@ -0,0 +1,8 @@ +tree_2_3_8 + +---- 1 => 1 + +---- 2 => 2 + `---- 3 => [2, 3, 4] + +---- 1 => 2 + +---- 2 => 3 + `---- 3 => 4 + \ No newline at end of file diff --git a/test/txtfiles/tree_2_3_9.txt b/test/txtfiles/tree_2_3_9.txt new file mode 100644 index 000000000..b30846e54 --- /dev/null +++ b/test/txtfiles/tree_2_3_9.txt @@ -0,0 +1,26 @@ +tree_2_3_9 + +---- 1 => 1 + +---- 2 => Any[2, [3, 4], "aaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"] + | +---- 1 => 2 + | +---- 2 => [3, 4] + | | +---- 1 => 3 + | | `---- 2 => 4 + | `---- 3 => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + | aaaaaaaaaaaaaaaaaaaaaaaa + +---- 3 => c + `---- 4 => OrderedDict(2 => "a", 1 => :ok, "a" => + 2, :test => [1, 2]) + +---- 2 => a + +---- 1 => ok + +---- a => 2 + `---- test => [1, 2] + +---- 1 => 1 + `---- 2 => 2 + \ No newline at end of file diff --git a/test/txtfiles/tree_3.txt b/test/txtfiles/tree_3.txt index b2769da28..43ab9d2f5 100644 --- a/test/txtfiles/tree_3.txt +++ b/test/txtfiles/tree_3.txt @@ -1,10 +1,11 @@ tree ━━━━━━ │  - ├── leaf2: 2 ├── leaf: 2 + ├── nested + │ ├── n1: 1 + │ └── n2: 2 ├── canopy: test ├── leafme: v - └── nested -  ├── n1: 1 -  └── n2: 2 \ No newline at end of file + ├── ["a"]: test + └── leaf2: 2 \ No newline at end of file diff --git a/test/txtfiles/tree_4.txt b/test/txtfiles/tree_4.txt index 163485a8b..704ff4329 100644 --- a/test/txtfiles/tree_4.txt +++ b/test/txtfiles/tree_4.txt @@ -1,12 +1,12 @@ - tree -━━━━━━ - │  - ├── nested2 - │ ├── n1: a - │ └── n2: 2 - └── nested -  ├── n3: 3 -  ├── n2: Int64 -  └── deeper -   ├── aleaf: unbeliefable -   └── leaflet: level 3 \ No newline at end of file + tree +━━━━━━ + │  + ├── nested2 + │ ├── n1: a + │ └── n2: 2 + └── nested +  ├── n3: 3 +  ├── n2: Int64 +  └── deeper +   ├── aleaf: unbeliefable +   └── leaflet: level 3level 3level 3level 3level 3level... \ No newline at end of file diff --git a/test/txtfiles/tree_expr_1.txt b/test/txtfiles/tree_expr_1.txt index 94df39b5c..1e3dd6141 100644 --- a/test/txtfiles/tree_expr_1.txt +++ b/test/txtfiles/tree_expr_1.txt @@ -1,11 +1,13 @@ - 2x+3y+2 -━━━━━━━━━ - │  - └── 2x+3y+2 (call: +) -  ├── 2x (call: *) -  │ ├── 2 -  │ └── x -  ├── 3y (call: *) -  │ ├── 3 -  │ └── y -  └── 2 \ No newline at end of file + +2x + 3y + 2 +├─ 1 ⇒ + +├─ 2 ⇒ 2x +│ ├─ 1 ⇒ * +│ ├─ 2 ⇒ 2 +│ └─ 3 ⇒ x +├─ 3 ⇒ 3y +│ ├─ 1 ⇒ * +│ ├─ 2 ⇒ 3 +│ └─ 3 ⇒ y +└─ 4 ⇒ 2 + diff --git a/test/txtfiles/tree_expr_2.txt b/test/txtfiles/tree_expr_2.txt index bf09ea771..654a2aaff 100644 --- a/test/txtfiles/tree_expr_2.txt +++ b/test/txtfiles/tree_expr_2.txt @@ -1,12 +1,14 @@ - 2x+3+2+2y -━━━━━━━━━━━ - │  - └── 2x+3+2+2y (call: +) -  ├── 2x (call: *) -  │ ├── 2 -  │ └── x -  ├── 3 -  ├── 2 -  └── 2y (call: *) -   ├── 2 -   └── y \ No newline at end of file + +2x + 3 + 2 + 2y +├─ 1 ⇒ + +├─ 2 ⇒ 2x +│ ├─ 1 ⇒ * +│ ├─ 2 ⇒ 2 +│ └─ 3 ⇒ x +├─ 3 ⇒ 3 +├─ 4 ⇒ 2 +└─ 5 ⇒ 2y + ├─ 1 ⇒ * + ├─ 2 ⇒ 2 + └─ 3 ⇒ y + diff --git a/test/txtfiles/tree_expr_3.txt b/test/txtfiles/tree_expr_3.txt index 577d43ba7..3b2b8a61b 100644 --- a/test/txtfiles/tree_expr_3.txt +++ b/test/txtfiles/tree_expr_3.txt @@ -1,10 +1,12 @@ - 2*x^(3+y) -━━━━━━━━━━━ - │  - └── 2*x^(3+y) (call: *) -  ├── 2 -  └── x^(3+y) (call: ^) -   ├── x -   └── 3+y (call: +) -    ├── 3 -    └── y \ No newline at end of file + +2 * x ^ (3 + y) +├─ 1 ⇒ * +├─ 2 ⇒ 2 +└─ 3 ⇒ x ^ (3 + y) + ├─ 1 ⇒ ^ + ├─ 2 ⇒ x + └─ 3 ⇒ 3 + y + ├─ 1 ⇒ + + ├─ 2 ⇒ 3 + └─ 3 ⇒ y + diff --git a/test/txtfiles/tree_expr_4.txt b/test/txtfiles/tree_expr_4.txt index 52217c3cb..649213fb3 100644 --- a/test/txtfiles/tree_expr_4.txt +++ b/test/txtfiles/tree_expr_4.txt @@ -1,12 +1,15 @@ - (1+1)-2*x^2 -━━━━━━━━━━━━━ - │  - └── (1+1)-2*x^2 (call: -) -  ├── 1+1 (call: +) -  │ ├── 1 -  │ └── 1 -  └── 2*x^2 (call: *) -   ├── 2 -   └── x^2 (call: ^) -    ├── x -    └── 2 \ No newline at end of file + +(1 + 1) - 2 * x ^ 2 +├─ 1 ⇒ - +├─ 2 ⇒ 1 + 1 +│ ├─ 1 ⇒ + +│ ├─ 2 ⇒ 1 +│ └─ 3 ⇒ 1 +└─ 3 ⇒ 2 * x ^ 2 + ├─ 1 ⇒ * + ├─ 2 ⇒ 2 + └─ 3 ⇒ x ^ 2 + ├─ 1 ⇒ ^ + ├─ 2 ⇒ x + └─ 3 ⇒ 2 + diff --git a/test/txtfiles/tree_expr_5.txt b/test/txtfiles/tree_expr_5.txt index f27d4c70f..5c5f3f5ee 100644 --- a/test/txtfiles/tree_expr_5.txt +++ b/test/txtfiles/tree_expr_5.txt @@ -1,6 +1,6 @@ - mod(22,6) -━━━━━━━━━━━ - │  - └── mod(22,6) (call: mod) -  ├── 22 -  └── 6 \ No newline at end of file + +mod(22, 6) +├─ 1 ⇒ mod +├─ 2 ⇒ 22 +└─ 3 ⇒ 6 + diff --git a/test/txtfiles/tree_expr_6.txt b/test/txtfiles/tree_expr_6.txt index 5ce11ee4f..da4b5bb15 100644 --- a/test/txtfiles/tree_expr_6.txt +++ b/test/txtfiles/tree_expr_6.txt @@ -1,14 +1,18 @@ - 2*x^(3+y)+2z -━━━━━━━━━━━━━━ - │  - └── 2*x^(3+y)+2z (call: +) -  ├── 2*x^(3+y) (call: *) -  │ ├── 2 -  │ └── x^(3+y) (call: ^) -  │  ├── x -  │  └── 3+y (call: +) -  │   ├── 3 -  │   └── y -  └── 2z (call: *) -   ├── 2 -   └── z \ No newline at end of file + +2 * x ^ (3 + y) + 2z +├─ 1 ⇒ + +├─ 2 ⇒ 2 * x ^ (3 + y) +│ ├─ 1 ⇒ * +│ ├─ 2 ⇒ 2 +│ └─ 3 ⇒ x ^ (3 + y) +│ ├─ 1 ⇒ ^ +│ ├─ 2 ⇒ x +│ └─ 3 ⇒ 3 + y +│ ├─ 1 ⇒ + +│ ├─ 2 ⇒ 3 +│ └─ 3 ⇒ y +└─ 3 ⇒ 2z + ├─ 1 ⇒ * + ├─ 2 ⇒ 2 + └─ 3 ⇒ z + diff --git a/test/txtfiles/tree_expr_7.txt b/test/txtfiles/tree_expr_7.txt index 943107efb..72465ed01 100644 --- a/test/txtfiles/tree_expr_7.txt +++ b/test/txtfiles/tree_expr_7.txt @@ -1,15 +1,20 @@ - 2x+3*√(3*x^2) -━━━━━━━━━━━━━━━ - │  - └── 2x+3*√(3*x^2) (call: +) -  ├── 2x (call: *) -  │ ├── 2 -  │ └── x -  └── 3*√(3*x^2) (call: *) -   ├── 3 -   └── √(3*x^2) (call: √) -    └── 3*x^2 (call: *) -     ├── 3 -     └── x^2 (call: ^) -      ├── x -      └── 2 \ No newline at end of file + +2x + 3 * √(3 * x ^ 2) +├─ 1 ⇒ + +├─ 2 ⇒ 2x +│ ├─ 1 ⇒ * +│ ├─ 2 ⇒ 2 +│ └─ 3 ⇒ x +└─ 3 ⇒ 3 * √(3 * x ^ 2) + ├─ 1 ⇒ * + ├─ 2 ⇒ 3 + └─ 3 ⇒ √(3 * x ^ 2) + ├─ 1 ⇒ √ + └─ 2 ⇒ 3 * x ^ 2 + ├─ 1 ⇒ * + ├─ 2 ⇒ 3 + └─ 3 ⇒ x ^ 2 + ├─ 1 ⇒ ^ + ├─ 2 ⇒ x + └─ 3 ⇒ 2 + diff --git a/test/txtfiles/tree_expr_8.txt b/test/txtfiles/tree_expr_8.txt index 6011d3abf..6a2c9b4f5 100644 --- a/test/txtfiles/tree_expr_8.txt +++ b/test/txtfiles/tree_expr_8.txt @@ -1,6 +1,7 @@ - print(lstrip("test")) -━━━━━━━━━━━━━━━━━━━━━━━ - │  - └── print(lstrip("test")) (call: print) -  └── lstrip("test") (call: lstrip) -   └── test \ No newline at end of file + +print(lstrip("test")) +├─ 1 ⇒ print +└─ 2 ⇒ lstrip("test") + ├─ 1 ⇒ lstrip + └─ 2 ⇒ test + diff --git a/test/txtfiles/trim_renderables_1.txt b/test/txtfiles/trim_renderables_1.txt index ead164037..9f15da429 100644 --- a/test/txtfiles/trim_renderables_1.txt +++ b/test/txtfiles/trim_renderables_1.txt @@ -1,27 +1,28 @@ -aa bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bbaa bbaa bbaa bbaa -bb \ No newline at end of file +aa bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bbaa bbaa bbaa bbaa +bb + \ No newline at end of file diff --git a/test/txtfiles/trim_renderables_2.txt b/test/txtfiles/trim_renderables_2.txt index 1c8a87fed..9f9273d08 100644 --- a/test/txtfiles/trim_renderables_2.txt +++ b/test/txtfiles/trim_renderables_2.txt @@ -1,10 +1,10 @@ -╭─────────────────────... -│ aa bbaa bbaa bbaa... -│ bbaa bbaa bbaa... -│ bbaa bbaa bbaa... -│ bbaa bbaa bbaa... -│ bbaa bbaa bbaa... -│ bbaa bbaa bbaa... -│ bbaa bbaa bbaa... -│ bbaa bbaa bb... -╰─────────────────────... \ No newline at end of file +╭─────────────────────... +│ aa bbaa bbaa bbaa... +│ bbaa bbaa bbaa... +│ bbaa bbaa bbaa... +│ bbaa bbaa bbaa... +│ bbaa bbaa bbaa... +│ bbaa bbaa bbaa... +│ bbaa bbaa bbaa... +│ bbaa bbaa bb... +╰─────────────────────... \ No newline at end of file