Add examples for GenericPath methods.

I wanted to use `assert_eq` throughout, but that does not seem possible (see #15625)
You could sneak around it like this:

```rust
/// ```
/// #[cfg(not(windows))]
/// # fn foo() {
/// ... dox dox dox
///
/// ... dox dox dox
/// # }
/// # #[cfg(windows)] fn foo() {}
/// # foo()
/// ```
```