Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jan 18, 2022
1 parent 9e9334b commit f4295f9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test1.expected
Original file line number Diff line number Diff line change
Expand Up @@ -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! 💪 │
├────────────────────────────────────┤
Expand All @@ -528,3 +539,8 @@ root
││ │└─────────────────┘││
│└──────────────┴───────────────────┘│
└────────────────────────────────────┘
┌─────────────────────────────────┐
│ab │
│cd no color here │
│hello world color me (but not me)│
└─────────────────────────────────┘
15 changes: 15 additions & 0 deletions test/test1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@
Expand All @@ -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

0 comments on commit f4295f9

Please sign in to comment.