You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Posix pahs like "/foo//bar" should be normalized to "/foo/bar". (WIndows likely has similar issues). Here is a test case:
// rustc --test normalize.rs && ./normalize
use std;
use Path = path::Path;
macro_rules! assert_equal (($expected: expr, $actual: expr) =>
{
let a = $actual; // only evaluate the expressions once
let e = $expected;
if a != e
{
fail fmt!("Found '%?', but expected '%?'", a, e);
}
})
// TODO: add a windows version of this
#[cfg(unix)]
fn root() -> Path
{
path::from_str(~"/tmp/")
}
#[test]
fn tester()
{
let path = root();
let path = path.push("/hmm");
let path = path.normalize();
assert_equal!(~"/tmp/hmm", path.to_str());
}
Activity
Auto merge of rust-lang#5602 - ebroto:issue_3430, r=phansch
Merge pull request rust-lang#3430 from rchaser53/no-arg-with-comment
Auto merge of rust-lang#3430 - RalfJung:doc, r=RalfJung
Merge rust-lang#3430
Merge rust-lang#3432