test_sysfile("variable_display_without_width");
}
+#[test]
+fn variable_display_with_width() {
+ test_sysfile("variable_display_with_width");
+}
+
fn test_sysfile(name: &str) {
let input_filename = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("src/sys/testdata")
--- /dev/null
+╭──────────────────────┬────────────────────────╮
+│ Created │ 01-JAN-2011 20:53:52│
+├──────────────────────┼────────────────────────┤
+│Writer Product │PSPP synthetic test file│
+├──────────────────────┼────────────────────────┤
+│ Compression │None │
+│ Number of Cases│ 0│
+╰──────────────────────┴────────────────────────╯
+
+╭─────────┬────────────────────────╮
+│Label │PSPP synthetic test file│
+│Variables│ 12│
+╰─────────┴────────────────────────╯
+
+╭─┬────────┬─────┬─────────────────┬─────┬─────┬─────────┬────────────┬────────────┬──────────────╮
+│ │Position│Label│Measurement Level│ Role│Width│Alignment│Print Format│Write Format│Missing Values│
+├─┼────────┼─────┼─────────────────┼─────┼─────┼─────────┼────────────┼────────────┼──────────────┤
+│a│ 1│ │Nominal │Input│ 1│Left │F8.0 │F8.0 │ │
+│b│ 2│ │Ordinal │Input│ 2│Left │F8.0 │F8.0 │ │
+│c│ 3│ │Scale │Input│ 3│Left │F8.0 │F8.0 │ │
+│d│ 4│ │Nominal │Input│ 4│Right │F8.0 │F8.0 │ │
+│h│ 5│ │Ordinal │Input│ 5│Right │A3 │A3 │ │
+│i│ 6│ │Scale │Input│ 6│Right │A3 │A3 │ │
+│j│ 7│ │Nominal │Input│ 7│Center │A3 │A3 │ │
+│k│ 8│ │Ordinal │Input│ 8│Center │A3 │A3 │ │
+│l│ 9│ │Scale │Input│ 9│Center │A9 │A9 │ │
+│m│ 10│ │Nominal │Input│ 10│Left │A10 │A10 │ │
+│n│ 11│ │Nominal │Input│ 11│Right │A17 │A17 │ │
+│o│ 12│ │Nominal │Input│ 12│Center │A25 │A25 │ │
+╰─┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
--- /dev/null
+# File header.
+"$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
+2; # Layout code
+19; # 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;
+
+# Numeric variables.
+2; 0; 0; 0; 0x050800 *2; s8 "A";
+2; 0; 0; 0; 0x050800 *2; s8 "B";
+2; 0; 0; 0; 0x050800 *2; s8 "C";
+2; 0; 0; 0; 0x050800 *2; s8 "D";
+
+# Short string variables.
+2; 3; 0; 0; 0x010300 *2; s8 "H";
+2; 3; 0; 0; 0x010300 *2; s8 "I";
+2; 3; 0; 0; 0x010300 *2; s8 "J";
+2; 3; 0; 0; 0x010300 *2; s8 "K";
+
+# Long string variables.
+2; 9; 0; 0; 0x010900 *2; s8 "L";
+2; -1; 0; 0; 0; 0; s8 "";
+2; 10; 0; 0; 0x010a00 *2; s8 "M";
+2; -1; 0; 0; 0; 0; s8 "";
+2; 17; 0; 0; 0x011100 *2; s8 "N";
+( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
+2; 25; 0; 0; 0x011900 *2; s8 "O";
+( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
+
+# Variable display parameters
+7; 11; 4; 36;
+1; 1; 0;
+2; 2; 0;
+3; 3; 0;
+1; 4; 1;
+2; 5; 1;
+3; 6; 1;
+1; 7; 2;
+2; 8; 2;
+3; 9; 2;
+0; 10; 0;
+0; 11; 1;
+0; 12; 2;
+
+# Character encoding record.
+7; 20; 1; 12; "windows-1252";
+
+# Dictionary termination record.
+999; 0;
+╭──────────────────────┬────────────────────────╮
+│ Created │ 01-JAN-2011 20:53:52│
+├──────────────────────┼────────────────────────┤
+│Writer Product │PSPP synthetic test file│
+├──────────────────────┼────────────────────────┤
+│ Compression │None │
+│ Number of Cases│ 0│
+╰──────────────────────┴────────────────────────╯
+
+╭─────────┬────────────────────────╮
+│Label │PSPP synthetic test file│
+│Variables│ 12│
+╰─────────┴────────────────────────╯
+
+╭─┬────────┬─────┬─────────────────┬─────┬─────┬─────────┬────────────┬────────────┬──────────────╮
+│ │Position│Label│Measurement Level│ Role│Width│Alignment│Print Format│Write Format│Missing Values│
+├─┼────────┼─────┼─────────────────┼─────┼─────┼─────────┼────────────┼────────────┼──────────────┤
+│a│ 1│ │Nominal │Input│ 8│Left │F8.0 │F8.0 │ │
+│b│ 2│ │Ordinal │Input│ 8│Left │F8.0 │F8.0 │ │
+│c│ 3│ │Scale │Input│ 8│Left │F8.0 │F8.0 │ │
+│d│ 4│ │Nominal │Input│ 8│Right │F8.0 │F8.0 │ │
+│h│ 5│ │Ordinal │Input│ 3│Right │A3 │A3 │ │
+│i│ 6│ │Scale │Input│ 3│Right │A3 │A3 │ │
+│j│ 7│ │Nominal │Input│ 3│Center │A3 │A3 │ │
+│k│ 8│ │Ordinal │Input│ 3│Center │A3 │A3 │ │
+│l│ 9│ │Scale │Input│ 9│Center │A9 │A9 │ │
+│m│ 10│ │Nominal │Input│ 10│Left │A10 │A10 │ │
+│n│ 11│ │Nominal │Input│ 17│Right │A17 │A17 │ │
+│o│ 12│ │Nominal │Input│ 25│Center │A25 │A25 │ │
+╰─┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯