• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbarbin / cubzzle / 159

21 Nov 2025 09:26AM UTC coverage: 77.955% (-0.7%) from 78.614%
159

Pull #19

github

web-flow
Merge 1e20bf144 into 347dba99d
Pull Request #19: Try fmt print config

101 of 135 new or added lines in 13 files covered. (74.81%)

1 existing line in 1 file now uncovered.

244 of 313 relevant lines covered (77.96%)

2012381.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/test/test__z_shape.ml
1
(*********************************************************************************)
2
(*  cubzzle - Solver for a wooden cube puzzle                                    *)
3
(*  SPDX-FileCopyrightText: 2022-2025 Mathieu Barbin <mathieu.barbin@gmail.com>  *)
4
(*  SPDX-License-Identifier: MIT                                                 *)
5
(*********************************************************************************)
6

7
let%expect_test "create" =
8
  (match
1✔
9
     Z_shape.create ~size:{ x = 3; y = 3; z = 3 }
10
       ~bottom:[| [| 0; 0; 0 |]; [| 0; 0; 0 |]; [| 0; 0; 0 |] |]
11
       ~top:[| [| 3; 3; 3 |]; [| 3; 3; 3 |]; [| 3; 3; 2 |] |]
12
   with
13
  | exception _ -> ()
1✔
NEW
14
  | t -> print_s [%sexp "Unexpected t", (t : Z_shape.t)]);
×
15
  [%expect {||}]
1✔
16

17
let%expect_test "samples" =
18
  List.iter Z_shape.Sample.all ~f:(fun sample ->
1✔
19
      let z_shape = Z_shape.sample sample in
6✔
20
      let sections = Z_shape.sections z_shape in
6✔
21
      print_s
6✔
22
        [%sexp
23
          {
24
            sample : Z_shape.Sample.t;
25
            z_shape : Z_shape.t;
26
            sections : Z_shape.Z_section.t array array;
27
          }]);
28
  [%expect
1✔
29
    {|
30
    ((sample Cube)
31
     (z_shape (
32
       (size (
33
         (x 3)
34
         (y 3)
35
         (z 3)))
36
       (bottom (
37
         (0 0 0)
38
         (0 0 0)
39
         (0 0 0)))
40
       (top (
41
         (3 3 3)
42
         (3 3 3)
43
         (3 3 3)))))
44
     (sections (
45
       (((bottom 0) (top 3))
46
        ((bottom 0) (top 3))
47
        ((bottom 0) (top 3)))
48
       (((bottom 0) (top 3))
49
        ((bottom 0) (top 3))
50
        ((bottom 0) (top 3)))
51
       (((bottom 0) (top 3))
52
        ((bottom 0) (top 3))
53
        ((bottom 0) (top 3))))))
54
    ((sample Dog)
55
     (z_shape (
56
       (size (
57
         (x 3)
58
         (y 4)
59
         (z 5)))
60
       (bottom (
61
         (0 1 0)
62
         (1 1 1)
63
         (0 1 0)
64
         (0 4 0)))
65
       (top (
66
         (3 3 3)
67
         (3 3 3)
68
         (4 5 4)
69
         (0 5 0)))))
70
     (sections (
71
       (((bottom 0) (top 3))
72
        ((bottom 1) (top 3))
73
        ((bottom 0) (top 4))
74
        ((bottom 0) (top 0)))
75
       (((bottom 1) (top 3))
76
        ((bottom 1) (top 3))
77
        ((bottom 1) (top 5))
78
        ((bottom 4) (top 5)))
79
       (((bottom 0) (top 3))
80
        ((bottom 1) (top 3))
81
        ((bottom 0) (top 4))
82
        ((bottom 0) (top 0))))))
83
    ((sample Tower)
84
     (z_shape (
85
       (size (
86
         (x 2)
87
         (y 2)
88
         (z 7)))
89
       (bottom ((0 0) (0 0)))
90
       (top    ((7 7) (7 6)))))
91
     (sections (
92
       (((bottom 0) (top 7))
93
        ((bottom 0) (top 7)))
94
       (((bottom 0) (top 7))
95
        ((bottom 0) (top 6))))))
96
    ((sample Misc_01)
97
     (z_shape (
98
       (size (
99
         (x 3)
100
         (y 5)
101
         (z 3)))
102
       (bottom (
103
         (0 0 0)
104
         (0 0 0)
105
         (0 0 0)
106
         (0 0 0)
107
         (0 0 0)))
108
       (top (
109
         (0 2 0)
110
         (2 2 2)
111
         (3 3 3)
112
         (3 3 2)
113
         (0 2 0)))))
114
     (sections (
115
       (((bottom 0) (top 0))
116
        ((bottom 0) (top 2))
117
        ((bottom 0) (top 3))
118
        ((bottom 0) (top 3))
119
        ((bottom 0) (top 0)))
120
       (((bottom 0) (top 2))
121
        ((bottom 0) (top 2))
122
        ((bottom 0) (top 3))
123
        ((bottom 0) (top 3))
124
        ((bottom 0) (top 2)))
125
       (((bottom 0) (top 0))
126
        ((bottom 0) (top 2))
127
        ((bottom 0) (top 3))
128
        ((bottom 0) (top 2))
129
        ((bottom 0) (top 0))))))
130
    ((sample Misc_02)
131
     (z_shape (
132
       (size (
133
         (x 4)
134
         (y 3)
135
         (z 4)))
136
       (bottom (
137
         (0 0 0 0)
138
         (0 0 0 0)
139
         (0 0 0 0)))
140
       (top (
141
         (2 3 4 0)
142
         (2 3 4 2)
143
         (3 0 2 2)))))
144
     (sections (
145
       (((bottom 0) (top 2))
146
        ((bottom 0) (top 2))
147
        ((bottom 0) (top 3)))
148
       (((bottom 0) (top 3))
149
        ((bottom 0) (top 3))
150
        ((bottom 0) (top 0)))
151
       (((bottom 0) (top 4))
152
        ((bottom 0) (top 4))
153
        ((bottom 0) (top 2)))
154
       (((bottom 0) (top 0))
155
        ((bottom 0) (top 2))
156
        ((bottom 0) (top 2))))))
157
    ((sample Misc_03)
158
     (z_shape (
159
       (size (
160
         (x 5)
161
         (y 2)
162
         (z 4)))
163
       (bottom (
164
         (0 0 0 0 0)
165
         (0 0 0 0 0)))
166
       (top (
167
         (3 3 3 2 2)
168
         (3 4 3 2 2)))))
169
     (sections (
170
       (((bottom 0) (top 3))
171
        ((bottom 0) (top 3)))
172
       (((bottom 0) (top 3))
173
        ((bottom 0) (top 4)))
174
       (((bottom 0) (top 3))
175
        ((bottom 0) (top 3)))
176
       (((bottom 0) (top 2))
177
        ((bottom 0) (top 2)))
178
       (((bottom 0) (top 2))
179
        ((bottom 0) (top 2)))))) |}]
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc