extern crate blc; use blc::*; use blc::encoding::binary::decompress; use blc::execution::Input; #[test] // program code from http://www.ioccc.org/2012/tromp/deflate.Blc fn deflate() { let code_compressed = [0x44, 0x68, 0x16, 0x05, 0x7e, 0x01, 0x17, 0x00, 0xbe, 0x55, 0xff, 0xf0, 0x0d, 0xc1, 0x8b, 0xb2, 0xc1, 0xb0, 0xf8, 0x7c, 0x2d, 0xd8, 0x05, 0x9e, 0x09, 0x7f, 0xbf, 0xb1, 0x48, 0x39, 0xce, 0x81, 0xce, 0x80]; let code_blc = decompress(&code_compressed); assert_eq!( run(&*code_blc, Input::Bytes(&*b"00000001011110100111010")).unwrap().as_bytes(), [0x1, 0x7a, 0x74] ); }