Skip to content

Commit 2f96cde

Browse files
committed
more tests
1 parent 9e9334b commit 2f96cde

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

test/test1.expected

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,32 @@ root
510510
│ │ 10│20 │
511511
│ │ │
512512
└─────┴──────────────────────────┘
513+
┌─────────────────┬──────────────────────────────────────────────────────────────┐
514+
│subject │announce: printbox 0.3 │
515+
├─────────────────┼──────────────────────────────────────────────────────────────┤
516+
│explanation │┌────────────────────────────────────────────────────────────┐│
517+
│ ││PrintBox is a library for rendering nested tables, ││
518+
│ ││ trees, and similar structures in monospace text or HTML.││
519+
│ │└────────────────────────────────────────────────────────────┘│
520+
├─────────────────┼──────────────────────────────────────────────────────────────┤
521+
│github │https://github.com/c-cube/printbox/releases/tag/0.3 │
522+
├─────────────────┼──────────────────────────────────────────────────────────────┤
523+
│contributors │Simon │
524+
│ ├──────────────────────────────────────────────────────────────┤
525+
│ │Guillaume │
526+
│ ├──────────────────────────────────────────────────────────────┤
527+
│ │Matt │
528+
├─────────────────┼──────────────────────────────────────────────────────────────┤
529+
│dependencies │├─mandatory │
530+
│ ││ ├─dune │
531+
│ ││ └─bytes │
532+
│ │└─optional │
533+
│ │ ├─uutf │
534+
│ │ ├─uucp │
535+
│ │ └─tyxml │
536+
├─────────────────┼──────────────────────────────────────────────────────────────┤
537+
│expected reaction│🎉 │
538+
└─────────────────┴──────────────────────────────────────────────────────────────┘
513539
┌────────────────────────────────────┐
514540
│nice unicode! 💪 │
515541
├────────────────────────────────────┤
@@ -528,3 +554,8 @@ root
528554
││ │└─────────────────┘││
529555
│└──────────────┴───────────────────┘│
530556
└────────────────────────────────────┘
557+
┌─────────────────────────────────┐
558+
│ab │
559+
│cd no color here │
560+
│hello world color me (but not me)│
561+
└─────────────────────────────────┘

test/test1.ml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ end
7878

7979
let b =
8080
let open PrintBox in
81-
frame @@ record [
81+
frame @@ v_record [
8282
("subject", text_with_style Style.bold "announce: printbox 0.3");
8383
("explanation",
8484
frame @@ text {|PrintBox is a library for rendering nested tables,
@@ -96,6 +96,9 @@ let b =
9696
("expected reaction", text "🎉");
9797
]
9898

99+
(* announcefor 0.3 *)
100+
let () = print_endline @@ PrintBox_text.to_string b
101+
99102
module Unicode = struct
100103
let b =
101104
B.(frame @@ vlist [text "nice unicode! 💪"; frame @@
@@ -107,3 +110,15 @@ module Unicode = struct
107110

108111
let () = print_endline @@ PrintBox_text.to_string b
109112
end
113+
114+
module Rich_text_ = struct
115+
let b =
116+
B.(frame @@ rich_text @@ Rich_text.(lines [
117+
cat [with_style Style.(bg_color Cyan) (s "ab\ncd"); s " no color here"];
118+
cat [s "hello"; space; s "world";
119+
with_style Style.(fg_color Green) (s " color me"); s " (but not me)"];
120+
]));;
121+
122+
let () = print_endline @@ PrintBox_text.to_string b
123+
124+
end

0 commit comments

Comments
 (0)