##// END OF EJS Templates
rhg: show a bug in the rust implementation of path_encode introduced recently...
Arseniy Alekseyev -
r51262:eb075918 stable
parent child Browse files
Show More
@@ -610,6 +610,18 b' mod tests {'
610 use crate::utils::hg_path::HgPathBuf;
610 use crate::utils::hg_path::HgPathBuf;
611
611
612 #[test]
612 #[test]
613 fn test_dirname_ends_with_underscore() {
614 let input = b"data/dir1234.foo/ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ.i";
615 // TODO: BUG: trailing dot should become an underscore
616 let expected = b"dh/dir1234./abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij.if2e9ce59e095eff5f8f334dc809e65606a0aa50b.i";
617 let res = path_encode(input);
618 assert_eq!(
619 HgPathBuf::from_bytes(&res),
620 HgPathBuf::from_bytes(expected)
621 );
622 }
623
624 #[test]
613 fn test_long_filename_at_root() {
625 fn test_long_filename_at_root() {
614 let input = b"data/ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ.i";
626 let input = b"data/ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ.i";
615 let expected = b"dh/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij.i708243a2237a7afae259ea3545a72a2ef11c247b.i";
627 let expected = b"dh/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij.i708243a2237a7afae259ea3545a72a2ef11c247b.i";
General Comments 0
You need to be logged in to leave comments. Login now