Sha256: bec061561203ccdce24a0f5754690fe4d38030036055a667f46b6f452a9d31ec

Contents?: true

Size: 818 Bytes

Versions: 30

Compression:

Stored size: 818 Bytes

Contents

#![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // WASI does not support all fs operations
#![cfg(windows)]

use tempfile::tempdir;
use tokio::fs;

#[tokio::test]
async fn symlink_file_windows() {
    const FILE_NAME: &str = "abc.txt";

    let temp_dir = tempdir().unwrap();

    let dir1 = temp_dir.path().join("a");
    fs::create_dir(&dir1).await.unwrap();

    let file1 = dir1.as_path().join(FILE_NAME);
    fs::write(&file1, b"Hello File!").await.unwrap();

    let dir2 = temp_dir.path().join("b");
    fs::symlink_dir(&dir1, &dir2).await.unwrap();

    fs::write(&file1, b"new data!").await.unwrap();

    let file2 = dir2.as_path().join(FILE_NAME);

    let from = fs::read(&file1).await.unwrap();
    let to = fs::read(&file2).await.unwrap();

    assert_eq!(from, to);
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/tokio-1.43.0/tests/fs_symlink_dir_windows.rs
wasmtime-28.0.0 ./ext/cargo-vendor/tokio-1.43.0/tests/fs_symlink_dir_windows.rs
wasmtime-27.0.0 ./ext/cargo-vendor/tokio-1.41.1/tests/fs_symlink_dir_windows.rs
wasmtime-26.0.0 ./ext/cargo-vendor/tokio-1.41.0/tests/fs_symlink_dir_windows.rs
wasmtime-25.0.2 ./ext/cargo-vendor/tokio-1.40.0/tests/fs_symlink_dir_windows.rs
wasmtime-25.0.1 ./ext/cargo-vendor/tokio-1.39.3/tests/fs_symlink_dir_windows.rs
wasmtime-25.0.0 ./ext/cargo-vendor/tokio-1.39.3/tests/fs_symlink_dir_windows.rs
wasmtime-24.0.0 ./ext/cargo-vendor/tokio-1.39.3/tests/fs_symlink_dir_windows.rs
wasmtime-23.0.2 ./ext/cargo-vendor/tokio-1.36.0/tests/fs_symlink_dir_windows.rs
wasmtime-22.0.0 ./ext/cargo-vendor/tokio-1.36.0/tests/fs_symlink_dir_windows.rs
wasmtime-21.0.1 ./ext/cargo-vendor/tokio-1.36.0/tests/fs_symlink_dir_windows.rs
wasmtime-20.0.2 ./ext/cargo-vendor/tokio-1.36.0/tests/fs_symlink_dir_windows.rs
wasmtime-20.0.0 ./ext/cargo-vendor/tokio-1.36.0/tests/fs_symlink_dir_windows.rs
wasmtime-18.0.3 ./ext/cargo-vendor/tokio-1.36.0/tests/fs_symlink_dir_windows.rs
wasmtime-17.0.1 ./ext/cargo-vendor/tokio-1.35.1/tests/fs_symlink_dir_windows.rs
wasmtime-17.0.0 ./ext/cargo-vendor/tokio-1.35.1/tests/fs_symlink_dir_windows.rs
wasmtime-16.0.0 ./ext/cargo-vendor/tokio-1.35.1/tests/fs_symlink_dir_windows.rs
wasmtime-15.0.1 ./ext/cargo-vendor/tokio-1.35.1/tests/fs_symlink_dir_windows.rs
wasmtime-15.0.0 ./ext/cargo-vendor/tokio-1.35.1/tests/fs_symlink_dir_windows.rs
wasmtime-14.0.4 ./ext/cargo-vendor/tokio-1.33.0/tests/fs_symlink_dir_windows.rs