From f4295f93803b0acffe9f886de4ff7986e0f67f31 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 18 Jan 2022 16:53:38 -0500 Subject: [PATCH] more tests --- test/test1.expected | 16 ++++++++++++++++ test/test1.ml | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/test/test1.expected b/test/test1.expected index 9afc55c..9313832 100644 --- a/test/test1.expected +++ b/test/test1.expected @@ -510,6 +510,17 @@ root │ │ 10│20 │ │ │ │ └─────┴──────────────────────────┘ +┌──────────────────────┬──────────────────────────────────────────────────────────────┬───────────────────────────────────────────────────┬────────────┬────────────┬─────────────────┐ +│subject │explanation │github │contributors│dependencies│expected reaction│ +├──────────────────────┼──────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────┼────────────┼────────────┼─────────────────┤ +│announce: printbox 0.3│┌────────────────────────────────────────────────────────────┐│https://github.com/c-cube/printbox/releases/tag/0.3│Simon │├─mandatory │🎉 │ +│ ││PrintBox is a library for rendering nested tables, ││ ├────────────┤│ ├─dune │ │ +│ ││ trees, and similar structures in monospace text or HTML.││ │Guillaume ││ └─bytes │ │ +│ │└────────────────────────────────────────────────────────────┘│ ├────────────┤└─optional │ │ +│ │ │ │Matt │ ├─uutf │ │ +│ │ │ │ │ ├─uucp │ │ +│ │ │ │ │ └─tyxml │ │ +└──────────────────────┴──────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────┴────────────┴────────────┴─────────────────┘ ┌────────────────────────────────────┐ │nice unicode! 💪 │ ├────────────────────────────────────┤ @@ -528,3 +539,8 @@ root ││ │└─────────────────┘││ │└──────────────┴───────────────────┘│ └────────────────────────────────────┘ +┌─────────────────────────────────┐ +│ab │ +│cd no color here │ +│hello world color me (but not me)│ +└─────────────────────────────────┘ diff --git a/test/test1.ml b/test/test1.ml index f957b1c..dd66a4e 100644 --- a/test/test1.ml +++ b/test/test1.ml @@ -96,6 +96,9 @@ let b = ("expected reaction", text "🎉"); ] +(* announcefor 0.3 *) +let () = print_endline @@ PrintBox_text.to_string b + module Unicode = struct let b = B.(frame @@ vlist [text "nice unicode! 💪"; frame @@ @@ -107,3 +110,15 @@ module Unicode = struct let () = print_endline @@ PrintBox_text.to_string b end + +module Rich_text_ = struct + let b = + B.(frame @@ rich_text @@ Rich_text.(lines [ + cat [with_style Style.(bg_color Cyan) (s "ab\ncd"); s " no color here"]; + cat [s "hello"; space; s "world"; + with_style Style.(fg_color Green) (s " color me"); s " (but not me)"]; + ]));; + + let () = print_endline @@ PrintBox_text.to_string b + +end