From 930a84a0f6a3eb7efe44854b5790218a7c20c4a0 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Mon, 1 Jun 2026 22:08:25 +0800 Subject: [PATCH] doc: add doc for test instruction --- wfassoc/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wfassoc/README.md b/wfassoc/README.md index 7aad4d5..bbc9e53 100644 --- a/wfassoc/README.md +++ b/wfassoc/README.md @@ -1,5 +1,7 @@ # WFassoc Core +## Usage + This crate provides low level API and high level API for manipulating Windows file associations at the same time. For the convenient use of this project, the root module of this crate re-expose high level API. So programmers can directly use them. @@ -10,3 +12,21 @@ Oppositely, for visiting low level API, please use `lowlevel` module. If you are a programmer who want to take a deep into the internal implementations, see `win32` module and its submodules for detail. + +## Test Notes + +Some tests of this crate may be dangerous because they need to manipulate Windows Registry. +So it is highlt recommend that run these tests in sandbox environment. +In detailed words, you should run `cargo test --no-run` to build all test first, +then fetch the path to executable tests according to this command shown on console. +Then execute these executable tests in your sandbox for testing this crate. +Additionally, some tests also need Administration permission for testing, +because it requires write permission in HKLM. + +If you do not test it with sandbox and administrative environment, +test program will assert paniked and tell you how to resolve these issues. + +The reason why do not run `cargo test` in sandbox environment directly, +is that `cargo` can not find built tests located in host machine. +It will try to fetch all dependencies again and rebuild test in sandbox entirely. +So we use this complex way for testing.