Sha256: 02ba203872a6ddd20c8e65471d77d544d85d6dfb4fd572b3f7782d73be01aafe

Contents?: true

Size: 682 Bytes

Versions: 31

Compression:

Stored size: 682 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() {
    let dir = tempdir().unwrap();

    let source_path = dir.path().join("foo.txt");
    let dest_path = dir.path().join("bar.txt");

    fs::write(&source_path, b"Hello File!").await.unwrap();
    fs::symlink_file(&source_path, &dest_path).await.unwrap();

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

    let from = fs::read(&source_path).await.unwrap();
    let to = fs::read(&dest_path).await.unwrap();

    assert_eq!(from, to);
}

Version data entries

31 entries across 31 versions & 1 rubygems

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