From 96df637cb4a9103c6952323cf7a8a0032a25ce75 Mon Sep 17 00:00:00 2001 From: riQQ Date: Fri, 12 Apr 2024 15:45:06 +0200 Subject: [PATCH 1/3] Fix typo in LINQ chapter --- src/linq/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linq/index.md b/src/linq/index.md index 7196515..1524289 100644 --- a/src/linq/index.md +++ b/src/linq/index.md @@ -219,7 +219,7 @@ then the output of the program will change radically: Int(5) dropped This time, values are acquired but not dropped while looping because each item -doesn't get owned by the interation loop's variable. The sum is printed ocne +doesn't get owned by the interation loop's variable. The sum is printed once the loop is done. Finally, when the `values` array that still owns all the the `Int` instances goes out of scope at the end of `main`, its dropping in turn drops all the `Int` instances. From b8651881e824f15462497f53eed3adcfa304ae78 Mon Sep 17 00:00:00 2001 From: riQQ Date: Fri, 12 Apr 2024 17:17:54 +0200 Subject: [PATCH 2/3] Fix copy paste mistake in Meta Programming chapter --- src/meta-programming/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meta-programming/index.md b/src/meta-programming/index.md index ab49208..d875582 100644 --- a/src/meta-programming/index.md +++ b/src/meta-programming/index.md @@ -99,7 +99,7 @@ async fn main() { } ``` -In order to understand how to define a custom derive macro, it is possible to +In order to understand how to define a custom attribute macro, it is possible to read the rust reference for [attribute macros] [attribute macros]: https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros From dd0a7f20e9fd7f371cd634d6eceac419be0cca4e Mon Sep 17 00:00:00 2001 From: riQQ Date: Fri, 12 Apr 2024 22:21:17 +0200 Subject: [PATCH 3/3] Editorial improvements in Testing chapter --- src/testing/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/testing/index.md b/src/testing/index.md index 9511f86..4fb5010 100644 --- a/src/testing/index.md +++ b/src/testing/index.md @@ -7,14 +7,14 @@ test framework being used (xUnit, NUnit, MSTest, etc.) and the type of tests (unit or integration) being wirtten. The test code therefore lives in a separate assembly than the application or library code being tested. In Rust, it is a lot more conventional for _unit tests_ to be found in a separate test -sub-module (conventionally) named `tests`, but which is placed in same _source +sub-module (conventionally) named `tests`, but which is placed in the same _source file_ as the application or library module code that is the subject of the tests. This has two benefits: - The code/module and its unit tests live side-by-side. - There is no need for a workaround like `[InternalsVisibleTo]` that exists in - .NET because the tests have access to internals by virtual of being a + .NET because the tests have access to internals by virtue of being a sub-module. The test sub-module is annotated with the `#[cfg(test)]` attribute, which has @@ -26,9 +26,9 @@ attribute. Integration tests are usually in a directory called `tests` that sits adjacent to the `src` directory with the unit tests and source. `cargo test` compiles -each file in that directory as a separate crate and run all the methods +each file in that directory as a separate crate and runs all the methods annotated with `#[test]` attribute. Since it is understood that integration -tests in the `tests` directory, there is no need to mark the modules in there +tests reside in the `tests` directory, there is no need to mark the modules in there with the `#[cfg(test)]` attribute. See also: @@ -69,7 +69,7 @@ For more information, see "[Showing Function Output][test-output]". ## Assertions .NET users have multiple ways to assert, depending on the framework being -used. For example, an assertion xUnit.net might look like: +used. For example, an assertion using xUnit.net might look like: ```csharp [Fact]