--- loncom/xml/lontable.test 2008/12/09 11:50:08 1.2 +++ loncom/xml/lontable.test 2008/12/23 11:49:32 1.3 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # Generating TeX tables. # -# $Id: lontable.test,v 1.2 2008/12/09 11:50:08 foxr Exp $ +# $Id: lontable.test,v 1.3 2008/12/23 11:49:32 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -219,7 +219,7 @@ ok($cell->{'colspan'} == 1, 'Colspan 2,2 # +----------+---------+----+-----------+---------+ -$testobject = new Apache::lontable(); +$testobject = new Apache::lontable({theme => "Dresden"}); $testobject->start_row(); $testobject->add_cell('2 cols 3 rows', {rowspan => 3, colspan => 2}); @@ -264,6 +264,7 @@ ok($cells->[1]->{'contents'} eq '2 cols $row = $testobject->get_row(1); $cells = $row->{'cells'}; + ok(scalar(@$cells) == 3, ' 3 cell hashes in row 1'); ok($cells->[0]->{'rowspan'} == 2, '2,1 rowspan carried from above'); ok($cells->[0]->{'colspan'} == 2, '2,1 colspan carried from above'); @@ -305,6 +306,7 @@ ok($cells->[0]->{'contents'} eq 'ordinar ok($cells->[1]->{'rowspan'} == 1, '4,2 rowspan'); ok($cells->[1]->{'colspan'} == 1, '4,2 colspan'); +my $contents = $cells->[1]->{'contents'}; ok($cells->[1]->{'contents'} eq 'ordinary cell', '4,2, contents'); ok($cells->[2]->{'rowspan'} == 1, "4,3 rowspan carried down"); @@ -312,5 +314,14 @@ ok($cells->[2]->{'colspan'} == 1, '4,3 c ok($cells->[2]->{'contents'} eq '', '4,3 contents empty'); ok($cells->[3]->{'rowspan'} == 1, "4,4 rowspan"); -ok($cells->[3]->{'colspan'} == 2, '4,4 colspan'); +ok($cells->[3]->{'colspan'} == 1, '4,4 colspan'); ok($cells->[3]->{'contents'} eq 'ordinary cell', '4,4 contents'); + + + +my $table = $testobject->generate(); +$table->set_filename('table.tex'); +$table->generate(); + + +