Skip to content

Commit

Permalink
Add documentation linking
Browse files Browse the repository at this point in the history
  • Loading branch information
joelparkerhenderson committed Sep 7, 2024
1 parent f0b0585 commit 57f7ee8
Show file tree
Hide file tree
Showing 813 changed files with 1,454 additions and 18,945 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "assertables"
version = "8.2.2"
version = "8.3.0"
authors = ["Joel Parker Henderson <joel@joelparkerhenderson.com>"]
edition = "2021"
description = "Assertables: Rust crate of macros `assert…!` for better tests, quality assurance, debug testing, and runtime reliability."
Expand Down
54 changes: 16 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ For infix numeric operators and infix logical operators:
For maybes:

* [`assert_result_ok!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_result_ok.html)
* [`assert_option_some!(a)`](macro@crate::assert_option_some)
* [`assert_option_some!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_option_some.html)

For collections such as arrays, vectors, maps, sets:

Expand Down Expand Up @@ -130,13 +130,13 @@ Abbreviations:

Shorthands:

* `path``AsRef<Path>`.
* `reader` ≈ method `reader.read*()`.
* `readee` ≈ function `read*(readee)`.
* `matcher``matcher.is_match(matchee)`
* `container`use `container.contains(containee)`
* `path`implements `AsRef<Path>`
* `reader` ≈ method `reader.read*()`
* `readee` ≈ function `read*(readee)`
* `matcher`such as `matcher.is_match(matchee)`
* `container`such as `container.contains(containee)`
* `set` ≈ a collection such as `::std::collections::BTreeSet`
* `bag` ≈ a collection such as `::std::collections::BTreeMap`.
* `bag` ≈ a collection such as `::std::collections::BTreeMap`

## Forms

Expand All @@ -153,7 +153,7 @@ Examples:

* [`assert_starts_with!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_starts_with.html) // panic!
* [`debug_assert_starts_with!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.debug_assert_starts_with.html) // panic! in debug mode
* [`assert_starts_with_as_result!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_starts_with_as_result.html); // return Ok or Err
* [`assert_starts_with_as_result!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_starts_with_as_result.html) // return Ok or Err


### Forms for messages
Expand Down Expand Up @@ -184,46 +184,24 @@ Examples:

## Change highlights

8.2:
8.3: Add `assert_poll_ready`, `assert_poll_pending`.

* Add `assert_infix`
8.2: Add `assert_infix`.

* Add submodules with smoke tests for better documentability.
8.1: Add `assert_result_ok`, `assert_result_err`, `assert_option_some`, `assert_option_none`.

8.1:
8.0: Add `assert_fs_read_to_string_*`. Breaking change: rename `assert_read_to_string_*` macros to `assert_io_read_to_string_*`.

* Add Result macros `assert_result_ok` and `assert_result_err`
7.x: Add `assert_in_delta`, `assert_in_epsilon`. Add `assert_fn_*` macros with multiple arities.

* Add Option macros `assert_option_some` and `assert_option_none`

8.0:

* Add `assert_fs_read_to_string_*` macros for comparing files.

* Breaking change: rename `assert_read_to_string_*` macros to `assert_io_read_to_string_*`. If you use these macros, then please update your code to use the new naming convention.

7.x:

* Add `assert_in_delta`, `assert_in_epsilon`.

* Add `assert_fn_*` macros with multiple arities.

* Add `cargo release` for optimized tagged releases.

6.x:

* Add `assert_starts_with`, `assert_ends_with`, `assert_contains`, `assert_is_match`.

* Add `debug_assert_*` macros everywhere.

* Add `GPL-3.0` license.
6.x: Add `assert_starts_with`, `assert_ends_with`, `assert_contains`, `assert_is_match`. Add `debug_assert_*` macros everywhere.


## Tracking

* Package: assertables-rust-crate
* Version: 8.2.2
* Version: 8.3.0
* Created: 2021-03-30T15:47:49Z
* Updated: 2024-09-07T12:31:17Z
* Updated: 2024-09-07T22:22:42Z
* License: MIT or Apache-2.0 or GPL-2.0 or GPL-3.0 or contact us for more
* Contact: Joel Parker Henderson (joel@sixarm.com)
52 changes: 5 additions & 47 deletions doc/lib/assert_bag/assert_bag_eq/index.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,9 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Assert a bag is equal to another."><title>lib::assert_bag::assert_bag_eq - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-c5d6553a23f1e5a6.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="lib" data-themes="" data-resource-suffix="" data-rustdoc-version="1.81.0 (eeb90cda1 2024-09-04)" data-channel="1.81.0" data-search-js="search-d234aafac6c221dd.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-d2fab2bf619172d3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../lib/index.html">lib</a></h2></div><h2 class="location"><a href="#">Module assert_bag_eq</a></h2><div class="sidebar-elems"><h2><a href="../index.html">In lib::assert_bag</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../../index.html">lib</a>::<wbr><a href="../index.html">assert_bag</a>::<wbr><a class="mod" href="#">assert_bag_eq</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../../src/lib/assert_bag/assert_bag_eq.rs.html#1-265">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Assert a bag is equal to another.</p>
<ul>
<li>
<p>If true, return <code>()</code>.</p>
</li>
<li>
<p>Otherwise, call <a href="https://doc.rust-lang.org/1.81.0/std/macro.panic.html" title="macro std::panic"><code>panic!</code></a> in order to print the values of the
expressions with their debug representations.</p>
</li>
</ul>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Return Ok
</span><span class="kw">let </span>a = [<span class="number">1</span>, <span class="number">1</span>];
<span class="kw">let </span>b = [<span class="number">1</span>, <span class="number">1</span>];
<span class="macro">assert_bag_eq!</span>(<span class="kw-2">&amp;</span>a, <span class="kw-2">&amp;</span>b);
<span class="comment">//-&gt; ()

// Panic with error message
</span><span class="kw">let </span>result = panic::catch_unwind(|| {
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Assert a bag is equal to another."><title>lib::assert_bag::assert_bag_eq - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-c5d6553a23f1e5a6.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="lib" data-themes="" data-resource-suffix="" data-rustdoc-version="1.81.0 (eeb90cda1 2024-09-04)" data-channel="1.81.0" data-search-js="search-d234aafac6c221dd.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-d2fab2bf619172d3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../lib/index.html">lib</a></h2></div><h2 class="location"><a href="#">Module assert_bag_eq</a></h2><div class="sidebar-elems"><h2><a href="../index.html">In lib::assert_bag</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../../index.html">lib</a>::<wbr><a href="../index.html">assert_bag</a>::<wbr><a class="mod" href="#">assert_bag_eq</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../../src/lib/assert_bag/assert_bag_eq.rs.html#1-226">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Assert a bag is equal to another.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
<span class="kw">let </span>a = [<span class="number">1</span>, <span class="number">1</span>];
<span class="kw">let </span>b = [<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>];
<span class="macro">assert_bag_eq!</span>(<span class="kw-2">&amp;</span>a, <span class="kw-2">&amp;</span>b);
<span class="comment">//-&gt; panic!
</span>});
<span class="macro">assert!</span>(result.is_err());
<span class="kw">let </span>actual = result.unwrap_err().downcast::&lt;String&gt;().unwrap().to_string();
<span class="kw">let </span>expect = <span class="macro">concat!</span>(
<span class="string">"assertion failed: `assert_bag_eq!(left_bag, right_bag)`\n"</span>,
<span class="string">" left_bag label: `&amp;a`,\n"</span>,
<span class="string">" left_bag debug: `[1, 1]`,\n"</span>,
<span class="string">" right_bag label: `&amp;b`,\n"</span>,
<span class="string">" right_bag debug: `[1, 1, 1]`,\n"</span>,
<span class="string">" left: `{1: 2}`,\n"</span>,
<span class="string">" right: `{1: 3}`"
</span>);
<span class="macro">assert_eq!</span>(actual, expect);

<span class="comment">// Panic with custom message
</span><span class="kw">let </span>result = panic::catch_unwind(|| {
<span class="kw">let </span>a = [<span class="number">1</span>, <span class="number">1</span>];
<span class="kw">let </span>b = [<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>];
<span class="macro">assert_bag_eq!</span>(<span class="kw-2">&amp;</span>a, <span class="kw-2">&amp;</span>b, <span class="string">"message"</span>);
<span class="comment">//-&gt; panic!
</span>});
<span class="macro">assert!</span>(result.is_err());
<span class="kw">let </span>actual = result.unwrap_err().downcast::&lt;String&gt;().unwrap().to_string();
<span class="kw">let </span>expect = <span class="string">"message"</span>;
<span class="macro">assert_eq!</span>(actual, expect);</code></pre></div>
<span class="kw">let </span>b = [<span class="number">1</span>, <span class="number">1</span>];
<span class="macro">assert_bag_eq!</span>(<span class="kw-2">&amp;</span>a, <span class="kw-2">&amp;</span>b);</code></pre></div>
<h2 id="module-macros"><a class="doc-anchor" href="#module-macros">§</a>Module macros</h2>
<ul>
<li><a href="../../macro.assert_bag_eq.html" title="macro lib::assert_bag_eq"><code>assert_bag_eq</code></a></li>
Expand Down
Loading

0 comments on commit 57f7ee8

Please sign in to comment.