Coverage Report - net.sourceforge.combean.test.mathprog.grooml.TestGTerm
 
Classes in this File Line Coverage Branch Coverage Complexity
TestGTerm
100%
2/2
N/A
0
TestGTerm$_testConstructWithDifferentIndices_closure1
100%
2/2
100%
6/6
0
 
 1  
 /*
 2  
     This file is part of Combean.
 3  
 
 4  
     Combean is free software; you can redistribute it and/or modify
 5  
     it under the terms of the GNU General Public License as published by
 6  
     the Free Software Foundation; either version 2 of the License, or
 7  
     (at your option) any later version.
 8  
 
 9  
     Combean is distributed in the hope that it will be useful,
 10  
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12  
     GNU General Public License for more details.
 13  
 
 14  
     You should have received a copy of the GNU General Public License
 15  
     along with Foobar; if not, write to the Free Software
 16  
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 17  
 */
 18  
 package net.sourceforge.combean.test.mathprog.grooml;
 19  
 
 20  
 
 21  
 import groovy.util.GroovyTestCase
 22  
 
 23  
 import net.sourceforge.combean.mathprog.grooml.GTerm;
 24  
 
 25  
 class TestGTerm extends GroovyTestCase {
 26  
     
 27  
     void testConstructWithDifferentIndices() {
 28  3
         static final CasesForConstruction = [
 29  
                                              [1, "2.0 x[1]"],
 30  
                                              [null, "2.0 x[]"],
 31  
                                              ["bar", "2.0 x[bar]"],
 32  
                                              [[1, 2], "2.0 x[1,2]"],
 33  
                                              [["a", "b"], "2.0 x[a,b]"],
 34  
                                              ];
 35  3
         CasesForConstruction.each{
 36  
             index, expectedToString ->
 37  15
             assertToString(new GTerm("x", index, 2.0), expectedToString);
 38  
         }
 39  
     }
 40  
 
 41  
 }