Closed skbeh closed 1 year ago
不加 --release 时测试通过。
--release
$ cargo test --release Compiling danmu2ass v0.2.2 Finished release [optimized] target(s) in 1.17s Running unittests src/lib.rs (target/release/deps/danmu2ass-2c26aa49fb432fe9) running 7 tests test ass_writer::tests::test_escape_text ... ok test ass_writer::tests::time_point_fmt ... ok test input_type::tests::parse_bv ... ok test xml_parser::tests::from_xml ... ok test input_type::tests::parse_season_or_episode ... ok test xml_parser::tests::parse_break_line ... FAILED test xml_parser::tests::iterator ... FAILED failures: ---- xml_parser::tests::parse_break_line stdout ---- thread 'xml_parser::tests::parse_break_line' panicked at 'assertion failed: `(left == right)` left: `"呵\n呵\n比\n你\n们\n更\n喜\n欢\n晚\n晚"`, right: `"0-呵\n呵\n比\n你\n们\n更\n喜\n欢\n晚\n晚"`', src/xml_parser.rs:357:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- xml_parser::tests::iterator stdout ---- thread 'xml_parser::tests::iterator' panicked at 'assertion failed: `(left == right)` left: `Danmu { timeline_s: 0.581, content: "快快快", type: Float, fontsize: 25, rgb: (227, 63, 255) }`, right: `Danmu { timeline_s: 0.581, content: "0-快快快", type: Float, fontsize: 25, rgb: (227, 63, 255) }`', src/xml_parser.rs:325:9 failures: xml_parser::tests::iterator xml_parser::tests::parse_break_line test result: FAILED. 5 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s error: test failed, to rerun pass `--lib`
预期内行为,目前 test 只会在 debug profile 下跑
不加
--release
时测试通过。