Skip to content

Commit 1ca42e5

Browse files
authored
Merge pull request #124 from Furon-Kuina/refine-ch21
Refine Chapter 21 translation.
2 parents 041a9a9 + b310095 commit 1ca42e5

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

src/SUMMARY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,20 @@
423423
- [引数のパース](std_misc/arg/matching.md)
424424
- [他言語関数インターフェイス](std_misc/ffi.md)
425425

426+
<!--
426427
- [Testing](testing.md)
427428
- [Unit testing](testing/unit_testing.md)
428429
- [Documentation testing](testing/doc_testing.md)
429430
- [Integration testing](testing/integration_testing.md)
430431
- [Dev-dependencies](testing/dev_dependencies.md)
432+
-->
433+
434+
- [テスト](testing.md)
435+
- [ユニットテスト](testing/unit_testing.md)
436+
- [ドキュメンテーションテスト](testing/doc_testing.md)
437+
- [インテグレーションテスト](testing/integration_testing.md)
438+
- [開発中の依存関係](testing/dev_dependencies.md)
439+
431440

432441
<!--
433442
- [Unsafe Operations](unsafe.md)

src/testing/dev_dependencies.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ One such example is [`pretty_assertions`](https://docs.rs/pretty_assertions/1.0.
1616
File `Cargo.toml`:
1717
-->
1818
そのようなクレートの例として、[`pretty_assertions`](https://docs.rs/pretty_assertions/1.0.0/pretty_assertions/index.html)クレートが挙げられます。これは、標準の`assert_eq!``assert_ne!`マクロを拡張して、差分をカラフルに表示するものです。
19+
1920
ファイル`Cargo.toml`:
2021

2122
```toml
2223
# standard crate data is left out
24+
# 本節の内容に関係のない行は省略しています。
2325
[dev-dependencies]
2426
pretty_assertions = "1"
2527
```

src/testing/doc_testing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ pub fn div(a: i32, b: i32) -> i32 {
6565
}
6666
```
6767

68+
<!--
6869
Code blocks in documentation are automatically tested
6970
when running the regular `cargo test` command:
71+
-->
72+
ドキュメンテーションコメント中のコードブロックは、`cargo test`コマンドで自動的にテストされます。
7073

7174
```shell
7275
$ cargo test
@@ -143,6 +146,5 @@ pub fn try_div(a: i32, b: i32) -> Result<i32, String> {
143146

144147
[doc-nursery]: https://rust-lang-nursery.github.io/api-guidelines/documentation.html
145148
[commonmark]: https://commonmark.org/
146-
[markdown]: https://daringfireball.net/projects/markdown/
147149
[RFC505]: https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md
148150
[question-instead-of-unwrap]: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#examples-use--not-try-not-unwrap-c-question-mark

src/testing/integration_testing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Each Rust source file in the `tests` directory is compiled as a separate crate.
7777
order to share some code between integration tests we can make a module with public
7878
functions, importing and using it within tests.
7979
-->
80-
`tests`ディレクトリにあるRustのソースファイルは別のクレートしてコンパイルされます。インテグレーションテストの間でコードを共有するには、パブリックな関数をモジュールに入れて、それぞれのテストでインポートして利用する方法があります。
80+
`tests`ディレクトリにあるRustのソースファイルは別のクレートとしてコンパイルされます。インテグレーションテストの間でコードを共有するには、パブリックな関数をモジュールに入れて、それぞれのテストでインポートして利用する方法があります。
8181

8282
<!--
8383
File `tests/common/mod.rs`:
@@ -115,9 +115,12 @@ fn test_add() {
115115
}
116116
```
117117

118+
<!--
118119
Creating the module as `tests/common.rs` also works, but is not recommended
119120
because the test runner will treat the file as a test crate and try to run tests
120121
inside it.
122+
-->
123+
モジュールを`tests/common.rs`に記述することも可能ですが、`tests/common.rs`中のテストも自動的に実行されてしまうため非推奨です。
121124

122125
[unit]: unit_testing.md
123126
[mod]: ../mod.md

0 commit comments

Comments
 (0)