From ce2b6ed4a7f4a0586fda04def787a2f91ae1f73d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 8 Jun 2025 10:39:11 -0700 Subject: [PATCH] work on mrsets --- rust/pspp/src/sys/test.rs | 5 ++ .../testdata/multiple_response_sets.expected | 0 .../sys/testdata/multiple_response_sets.sack | 57 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 rust/pspp/src/sys/testdata/multiple_response_sets.expected create mode 100644 rust/pspp/src/sys/testdata/multiple_response_sets.sack diff --git a/rust/pspp/src/sys/test.rs b/rust/pspp/src/sys/test.rs index f94b147db0..a489ddf514 100644 --- a/rust/pspp/src/sys/test.rs +++ b/rust/pspp/src/sys/test.rs @@ -50,6 +50,11 @@ fn variable_sets() { test_sysfile("variable_sets"); } +#[test] +fn multiple_response_sets() { + test_sysfile("multiple_response_sets"); +} + fn test_sysfile(name: &str) { let input_filename = Path::new(env!("CARGO_MANIFEST_DIR")) .join("src/sys/testdata") diff --git a/rust/pspp/src/sys/testdata/multiple_response_sets.expected b/rust/pspp/src/sys/testdata/multiple_response_sets.expected new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rust/pspp/src/sys/testdata/multiple_response_sets.sack b/rust/pspp/src/sys/testdata/multiple_response_sets.sack new file mode 100644 index 0000000000..67c9b0b4bd --- /dev/null +++ b/rust/pspp/src/sys/testdata/multiple_response_sets.sack @@ -0,0 +1,57 @@ +# File header. +"$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file"; +2; # Layout code +16; # Nominal case size +0; # Not compressed +0; # Not weighted +0; # No cases. +100.0; # Bias. +"01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file"; +i8 0 *3; + +# $a +2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 ""; +2; 0; 0; 0; 0x050800 *2; s8 "B"; +2; 0; 0; 0; 0x050800 *2; s8 "C"; + +# $b +2; 0; 0; 0; 0x050800 *2; s8 "D"; +2; 0; 0; 0; 0x050800 *2; s8 "E"; +2; 0; 0; 0; 0x050800 *2; s8 "F"; +2; 0; 0; 0; 0x050800 *2; s8 "G"; + +# $c +2; 4; 0; 0; 0x010400 *2; s8 "H"; +2; 4; 0; 0; 0x010400 *2; s8 "I"; +2; 4; 0; 0; 0x010400 *2; s8 "J"; + +# $d +2; 0; 0; 0; 0x050800 *2; s8 "K"; +2; 0; 0; 0; 0x050800 *2; s8 "L"; +2; 0; 0; 0; 0x050800 *2; s8 "M"; + +# $e +2; 6; 0; 0; 0x010600 *2; s8 "N"; +2; 6; 0; 0; 0x010600 *2; s8 "O"; +2; 6; 0; 0; 0x010600 *2; s8 "P"; + +# Machine integer info record. +7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932; + +7; 7; 1; +COUNT( + "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10; + "$b=D2 55 0 g e f d"; i8 10; i8 10; + "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10); + +7; 19; 1; +COUNT( + i8 10; + "$d=E 1 2 34 13 third mdgroup k l m"; i8 10; + "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10); + +# Character encoding record. +7; 20; 1; 9; "shift_jis"; + +# Dictionary termination record. +999; 0; -- 2.30.2