From: Ben Pfaff Date: Mon, 4 Aug 2025 20:16:17 +0000 (-0700) Subject: all write records tested! X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f7fdad464dcd04f8e4844f5f6bd57fdd671d250;p=pspp all write records tested! --- diff --git a/rust/pspp/src/sys/write.rs b/rust/pspp/src/sys/write.rs index 02e3ff5e2e..7cd05e8699 100644 --- a/rust/pspp/src/sys/write.rs +++ b/rust/pspp/src/sys/write.rs @@ -1930,4 +1930,18 @@ $e=E 11 6 choice 0 n o p )" ); } + + #[test] + fn encoding() { + let dictionary = Dictionary::new(UTF_8); + let mut raw = Vec::new(); + DictionaryWriter::new( + &WriteOptions::reproducible(None), + &mut Cursor::new(&mut raw), + &dictionary, + ) + .write_encoding() + .unwrap(); + assert_eq!(str::from_utf8(&raw[16..]).unwrap(), "UTF-8"); + } }