Browse Source

Small comment about testing in Rust

master
Julio Biason 5 years ago
parent
commit
e4eeb6b805
  1. 29
      porque-rust.html

29
porque-rust.html

@ -780,7 +780,7 @@ fn get_summary(summarizable: T) -> String
<h2>Structs genéricas</h2>
<pre><code class="hljs rust" data-trim>
struct Point<T> {
struct Point&lt;T&gt; {
x: T,
y: T
}
@ -788,6 +788,33 @@ struct Point<T> {
</section>
</section>
<section>
<section>
<h2>Tests</h2>
<pre><code class="hljs rust" data-trim>
#[cfg(test)]
mod tests {
#[test]
fn testing() {
}
}
</code></pre>
</section>
<section>
<pre><code>
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished dev [unoptimized + debuginfo] target(s) in 0.22 secs
Running target/debug/deps/adder-ce99bcc2479f4607
running 1 test
test tests::testing ... ok
</code></pre>
</section>
</section>
<section>
<section>
<h2>Crazy stuff</h2>

Loading…
Cancel
Save