Mercurial > core / rust/lib/util/src/tests.rs
changeset 698: |
96958d3eb5b0 |
parent: |
0ccbbd142694
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
3 fn test_related_paths() { 4 use crate::path::local_relative_path; 6 local_relative_path(Path::new(".")).unwrap(); 9 #[cfg(feature = "fmt")] 12 use crate::fmt::StringTreeNode; 13 let tt = StringTreeNode::with_child_nodes( 16 StringTreeNode::with_child_nodes( 18 vec![StringTreeNode::with_child_nodes( 19 "Child 2".to_string(), 20 vec![StringTreeNode::with_child_nodes( 21 "Grand Child 2".to_string(), 22 vec![StringTreeNode::with_children( 23 "Great Grand Child 2".to_string(), 24 vec!["Great Great Grand Child 2".to_string()].into_iter(), 32 StringTreeNode::with_children( 34 vec!["Child 3".to_string()].into_iter(), 40 let tt_string = "Home\n+-- \n| '-- Child 2\n| '-- Grand Child 2\n| '-- Great Grand Child 2\n| '-- Great Great Grand Child 2\n'-- Posts\n '-- Child 3\n"; 42 assert_eq!(tt.to_string(), tt_string);