@@ -142,6 +142,7 @@ void testOneFM() {
142142
143143 CTC ratio: 0.4
144144 #features: 12
145+ #leaf features: 9
145146 #relationships: 6
146147 #constraints: 4
147148 #MANDATORY: 2
@@ -153,6 +154,48 @@ void testOneFM() {
153154 assertEquals (expected , content .get ());
154155 }
155156
157+ @ Test
158+ void testOneFM_2 () {
159+ String [] args = new String []{"-fm" , "./src/test/resources/fms/bamboobike.fm4conf" };
160+
161+ KBStatistics_CmdLineOptions options = new KBStatistics_CmdLineOptions (null , programTitle , null , usage );
162+ options .parseArgument (args );
163+
164+ KBStatistics kbStatistics = new KBStatistics (options );
165+
166+ assertDoesNotThrow (kbStatistics ::calculate );
167+
168+ File file = new File ("statistics.txt" );
169+ assertTrue (file .exists ());
170+
171+ // read the content from file
172+ AtomicReference <String > content = new AtomicReference <>("" );
173+ assertDoesNotThrow (() -> content .set (String .join ("\n " , Files .readAllLines (file .toPath ()))));
174+
175+ String expected = """
176+ 1
177+ Name: bamboobike.fm4conf
178+ Source: SPLOT
179+ #variables: 11
180+ #constraints: 8
181+ #Choco variables: 26
182+ #Choco constraints: 20
183+ Consistency: true
184+
185+ CTC ratio: 0.25
186+ #features: 11
187+ #leaf features: 8
188+ #relationships: 6
189+ #constraints: 2
190+ #MANDATORY: 2
191+ #OPTIONAL: 2
192+ #ALTERNATIVE: 1
193+ #OR: 1
194+ #REQUIRES: 1
195+ #EXCLUDES: 1""" ;
196+ assertEquals (expected , content .get ());
197+ }
198+
156199 @ Test
157200 void testManyFMs () {
158201 String [] args = new String []{"-fm-dir" , "./src/test/resources/fms" };
@@ -183,6 +226,7 @@ void testManyFMs() {
183226
184227 CTC ratio: 0.25
185228 #features: 11
229+ #leaf features: 8
186230 #relationships: 6
187231 #constraints: 2
188232 #MANDATORY: 2
@@ -202,6 +246,7 @@ void testManyFMs() {
202246
203247 CTC ratio: 0.25
204248 #features: 11
249+ #leaf features: 8
205250 #relationships: 6
206251 #constraints: 2
207252 #MANDATORY: 2
@@ -221,6 +266,7 @@ void testManyFMs() {
221266
222267 CTC ratio: 0.25
223268 #features: 11
269+ #leaf features: 8
224270 #relationships: 6
225271 #constraints: 2
226272 #MANDATORY: 2
@@ -240,6 +286,7 @@ void testManyFMs() {
240286
241287 CTC ratio: 0.25
242288 #features: 11
289+ #leaf features: 8
243290 #relationships: 6
244291 #constraints: 2
245292 #MANDATORY: 2
@@ -259,6 +306,7 @@ void testManyFMs() {
259306
260307 CTC ratio: 0.3218390804597701
261308 #features: 263
309+ #leaf features: 160
262310 #relationships: 177
263311 #constraints: 84
264312 #MANDATORY: 67
@@ -278,6 +326,7 @@ void testManyFMs() {
278326
279327 CTC ratio: 0.25
280328 #features: 11
329+ #leaf features: 8
281330 #relationships: 6
282331 #constraints: 2
283332 #MANDATORY: 2
@@ -297,6 +346,7 @@ void testManyFMs() {
297346
298347 CTC ratio: 0.4
299348 #features: 12
349+ #leaf features: 9
300350 #relationships: 6
301351 #constraints: 4
302352 #MANDATORY: 2
@@ -346,6 +396,7 @@ void testManyFMsAndKB() {
346396
347397 CTC ratio: 0.25
348398 #features: 11
399+ #leaf features: 8
349400 #relationships: 6
350401 #constraints: 2
351402 #MANDATORY: 2
@@ -365,6 +416,7 @@ void testManyFMsAndKB() {
365416
366417 CTC ratio: 0.25
367418 #features: 11
419+ #leaf features: 8
368420 #relationships: 6
369421 #constraints: 2
370422 #MANDATORY: 2
@@ -384,6 +436,7 @@ void testManyFMsAndKB() {
384436
385437 CTC ratio: 0.25
386438 #features: 11
439+ #leaf features: 8
387440 #relationships: 6
388441 #constraints: 2
389442 #MANDATORY: 2
@@ -403,6 +456,7 @@ void testManyFMsAndKB() {
403456
404457 CTC ratio: 0.25
405458 #features: 11
459+ #leaf features: 8
406460 #relationships: 6
407461 #constraints: 2
408462 #MANDATORY: 2
@@ -422,6 +476,7 @@ void testManyFMsAndKB() {
422476
423477 CTC ratio: 0.3218390804597701
424478 #features: 263
479+ #leaf features: 160
425480 #relationships: 177
426481 #constraints: 84
427482 #MANDATORY: 67
@@ -441,6 +496,7 @@ void testManyFMsAndKB() {
441496
442497 CTC ratio: 0.25
443498 #features: 11
499+ #leaf features: 8
444500 #relationships: 6
445501 #constraints: 2
446502 #MANDATORY: 2
@@ -460,6 +516,7 @@ void testManyFMsAndKB() {
460516
461517 CTC ratio: 0.4
462518 #features: 12
519+ #leaf features: 9
463520 #relationships: 6
464521 #constraints: 4
465522 #MANDATORY: 2
0 commit comments