Temporary Disabled. :) please Go back Testing - Rust By Example www.fgks.org » Address: [go: up one dir, main page] Include Form Remove Scripts Accept Cookies Show Images Show Referer Rotate13 Base64 Strip Meta Strip Title Session Cookies Introduction1. Hello World❱1.1. Comments1.2. Formatted print❱1.2.1. Debug1.2.2. Display❱1.2.2.1. Testcase: List1.2.3. Formatting2. Primitives❱2.1. Literals and operators2.2. Tuples2.3. Arrays and Slices3. Custom Types❱3.1. Structures3.2. Enums❱3.2.1. use3.2.2. C-like3.2.3. Testcase: linked-list3.3. constants4. Variable Bindings❱4.1. Mutability4.2. Scope and Shadowing4.3. Declare first4.4. Freezing5. Types❱5.1. Casting5.2. Literals5.3. Inference5.4. Aliasing6. Conversion❱6.1. From and Into6.2. TryFrom and TryInto6.3. To and from Strings7. Expressions8. Flow of Control❱8.1. if/else8.2. loop❱8.2.1. Nesting and labels8.2.2. Returning from loops8.3. while8.4. for and range8.5. match❱8.5.1. Destructuring❱8.5.1.1. tuples8.5.1.2. arrays/slices8.5.1.3. enums8.5.1.4. pointers/ref8.5.1.5. structs8.5.2. Guards8.5.3. Binding8.6. if let8.7. let-else8.8. while let9. Functions❱9.1. Methods9.2. Closures❱9.2.1. Capturing9.2.2. As input parameters9.2.3. Type anonymity9.2.4. Input functions9.2.5. As output parameters9.2.6. Examples in std❱9.2.6.1. Iterator::any9.2.6.2. Searching through iterators9.3. Higher Order Functions9.4. Diverging functions10. Modules❱10.1. Visibility10.2. Struct visibility10.3. The use declaration10.4. super and self10.5. File hierarchy11. Crates❱11.1. Creating a Library11.2. Using a Library12. Cargo❱12.1. Dependencies12.2. Conventions12.3. Tests12.4. Build Scripts13. Attributes❱13.1. dead_code13.2. Crates13.3. cfg❱13.3.1. Custom14. Generics❱14.1. Functions14.2. Implementation14.3. Traits14.4. Bounds❱14.4.1. Testcase: empty bounds14.5. Multiple bounds14.6. Where clauses14.7. New Type Idiom14.8. Associated items❱14.8.1. The Problem14.8.2. Associated types14.9. Phantom type parameters❱14.9.1. Testcase: unit clarification15. Scoping rules❱15.1. RAII15.2. Ownership and moves❱15.2.1. Mutability15.2.2. Partial moves15.3. Borrowing❱15.3.1. Mutability15.3.2. Aliasing15.3.3. The ref pattern15.4. Lifetimes❱15.4.1. Explicit annotation15.4.2. Functions15.4.3. Methods15.4.4. Structs15.4.5. Traits15.4.6. Bounds15.4.7. Coercion15.4.8. Static15.4.9. Elision16. Traits❱16.1. Derive16.2. Returning Traits with dyn16.3. Operator Overloading16.4. Drop16.5. Iterators16.6. impl Trait16.7. Clone16.8. Supertraits16.9. Disambiguating overlapping traits17. macro_rules!❱17.1. Syntax❱17.1.1. Designators17.1.2. Overload17.1.3. Repeat17.2. DRY (Don't Repeat Yourself)17.3. DSL (Domain Specific Languages)17.4. Variadics18. Error handling❱18.1. panic18.2. abort & unwind18.3. Option & unwrap❱18.3.1. Unpacking options with ?18.3.2. Combinators: map18.3.3. Combinators: and_then18.3.4. Defaults: or, or_else, get_or_insert, get_or_insert_with18.4. Result❱18.4.1. map for Result18.4.2. aliases for Result18.4.3. Early returns18.4.4. Introducing ?18.5. Multiple error types❱18.5.1. Pulling Results out of Options18.5.2. Defining an error type18.5.3. Boxing errors18.5.4. Other uses of ?18.5.5. Wrapping errors18.6. Iterating over Results19. Std library types❱19.1. Box, stack and heap19.2. Vectors19.3. Strings19.4. Option19.5. Result❱19.5.1. ?19.6. panic!19.7. HashMap❱19.7.1. Alternate/custom key types19.7.2. HashSet19.8. Rc19.9. Arc20. Std misc❱20.1. Threads❱20.1.1. Testcase: map-reduce20.2. Channels20.3. Path20.4. File I/O❱20.4.1. open20.4.2. create20.4.3. read_lines20.5. Child processes❱20.5.1. Pipes20.5.2. Wait20.6. Filesystem Operations20.7. Program arguments❱20.7.1. Argument parsing20.8. Foreign Function Interface21. Testing❱21.1. Unit testing21.2. Documentation testing21.3. Integration testing21.4. Dev-dependencies22. Unsafe Operations❱22.1. Inline assembly23. Compatibility❱23.1. Raw identifiers24. Meta❱24.1. Documentation24.2. Playground Light Rust Coal Navy Ayu Rust By Example English 日本語 Testing Rust is a programming language that cares a lot about correctness and it includes support for writing software tests within the language itself. Testing comes in three styles: Unit testing. Doc testing. Integration testing. Also Rust has support for specifying additional dependencies for tests: Dev-dependencies See Also The Book chapter on testing API Guidelines on doc-testing
Rust is a programming language that cares a lot about correctness and it includes support for writing software tests within the language itself.
Testing comes in three styles:
Also Rust has support for specifying additional dependencies for tests: