+
+
+#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 (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");
+colour =>blue, pink, violet
+nationality =>foreign
+size =>large
+EOF
+
+}