+
+
+#Test reading of custom attributes
+{
+ my $tempdir = tempdir( CLEANUP => 1 );
+
+ generate_sav_file ("$tempdir/in.sav", "$tempdir");
+
+ my $sf = PSPP::Reader->open ("$tempdir/in.sav");
+
+ my $dict = $sf->get_dict ();
+
+ my $var = $dict->get_var_by_name ("numeric");
+
+ my $attr = $var->get_attributes ();
+
+ open (MYFILE, ">$tempdir/out.txt");
+
+ foreach $k (sort (keys (%$attr)))
+ {
+ my $ll = $attr->{$k};
+ print MYFILE "$k =>";
+ print MYFILE map "$_\n", join ', ', @$ll;
+ }
+
+ close (MYFILE);
+
+ ok (compare ("$tempdir/out.txt", <<'EOF'), "Custom Attributes");
+$@Role =>0
+colour =>blue, pink, violet
+nationality =>foreign
+size =>large
+EOF
+}
+
+
+# Test of the get_case_cnt function
+{
+ my $tempdir = tempdir( CLEANUP => 1 );
+
+ generate_sav_file ("$tempdir/in.sav", "$tempdir");
+
+ my $sf = PSPP::Reader->open ("$tempdir/in.sav");
+
+ my $n = $sf->get_case_cnt ();
+
+ ok ($n == 5, "Case count");
+}