nano9 0.1.0-alpha.8

A Pico-8 compatibility layer for Bevy
Documentation
use std::path::{Path, PathBuf};

#[test]
fn test_path_dotdot() {
    let mut p = PathBuf::from("a/b/c");
    p.push("../d");
    assert_eq!(p, Path::new("a/b/c/../d"));
}

#[test]
fn test_path0() {
    let mut p = PathBuf::from("a/b/c/");
    assert!(p.pop());
    p.push("d");
    assert_eq!(p, Path::new("a/b/d"));
    assert!(p.pop());
    assert_eq!(p, Path::new("a/b"));
    assert!(p.pop());
    assert_eq!(p, Path::new("a"));
    assert_eq!(p, Path::new("a/"));
    assert!(p.pop());
    assert_eq!(p, Path::new(""));
    assert_eq!(p, Path::new(""));
    assert!(!p.pop());
}