-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shorter macro names for Result, Option, Poll
- Loading branch information
1 parent
41bf810
commit cd59bcc
Showing
335 changed files
with
10,561 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "assertables" | ||
version = "8.6.0" | ||
version = "8.7.0" | ||
authors = ["Joel Parker Henderson <[email protected]>"] | ||
edition = "2021" | ||
description = "Assertables: Rust crate of macros `assert…!` for better tests, quality assurance, debug testing, and runtime reliability." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,17 @@ compile-time tests and run-time reliability. | |
The Rust programming language provides assert macros to test code: | ||
|
||
* [`assert!()`](https://doc.rust-lang.org/std/macro.assert.html) | ||
* [`assert_eq!(a, b)`](https://doc.rust-lang.org/std/macro.assert_eq.html) | ||
* [`assert_ne!(a, b)`]((https://doc.rust-lang.org/std/macro.assert_ne.html) | ||
* [`assert_eq!(a, b)`](https://doc.rust-lang.org/std/macro.assert_eq.html) `// equal` | ||
* [`assert_ne!(a, b)`](https://doc.rust-lang.org/std/macro.assert_ne.html) `// not equal` | ||
|
||
The assertables crate provides many more, so you can write smarter tests. | ||
|
||
For values: | ||
|
||
* [`assert_lt!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_lt.html) // less than | ||
* [`assert_le!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_le.html) // less than or equal to | ||
* [`assert_gt!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_gt.html) // greater than | ||
* [`assert_ge!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_ge.html) // greater than or equal to | ||
* [`assert_lt!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_lt.html) `// less than` | ||
* [`assert_le!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_le.html) `// less than or equal` | ||
* [`assert_gt!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_gt.html) `// greater than` | ||
* [`assert_ge!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_ge.html) `// greater than or equal` | ||
|
||
For strings: | ||
|
||
|
@@ -46,26 +46,26 @@ For numbers: | |
* [`assert_in_delta!(a, b, delta)`](https://docs.rs/assertables/latest/assertables/macro.assert_in_delta.html) | ||
* [`assert_in_epsilon!(a, b, epsilon)`](https://docs.rs/assertables/latest/assertables/macro.assert_in_epsilon.html) | ||
|
||
For results: | ||
For Result: | ||
|
||
* [`assert_result_ok!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_result_ok.html) | ||
* [`assert_result_ok_eq!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_result_ok_eq.html) | ||
* [`assert_result_ok_ne!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_result_ok_ne.html) | ||
* [`assert_result_err!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_result_err.html) | ||
* [`assert_ok!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_ok.html) | ||
* [`assert_ok_eq!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_ok_eq.html) | ||
* [`assert_ok_ne!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_ok_ne.html) | ||
* [`assert_err!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_err.html) | ||
|
||
For options: | ||
For Option: | ||
|
||
* [`assert_option_some!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_option_some.html) | ||
* [`assert_option_some_eq!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_option_some_eq.html) | ||
* [`assert_option_some_ne!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_option_some_ne.html) | ||
* [`assert_option_none!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_option_none.html) | ||
* [`assert_some!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_some.html) | ||
* [`assert_some_eq!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_some_eq.html) | ||
* [`assert_some_ne!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_some_ne.html) | ||
* [`assert_none!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_none.html) | ||
|
||
For polls: | ||
For Poll: | ||
|
||
* [`assert_poll_ready!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_poll_ready.html) | ||
* [`assert_poll_ready_eq!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_poll_ready_eq.html) | ||
* [`assert_poll_ready_ne!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_poll_ready_ne.html) | ||
* [`assert_poll_pending!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_poll_pending.html) | ||
* [`assert_ready!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_ready.html) | ||
* [`assert_ready_eq!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_ready_eq.html) | ||
* [`assert_ready_ne!(a, b)`](https://docs.rs/assertables/latest/assertables/macro.assert_ready_ne.html) | ||
* [`assert_pending!(a)`](https://docs.rs/assertables/latest/assertables/macro.assert_pending.html) | ||
|
||
For collections such as arrays, vectors, maps, sets: | ||
|
||
|
@@ -182,8 +182,8 @@ Examples: | |
## Tracking | ||
|
||
* Package: assertables-rust-crate | ||
* Version: 8.6.0 | ||
* Version: 8.7.0 | ||
* Created: 2021-03-30T15:47:49Z | ||
* Updated: 2024-09-18T03:02:31Z | ||
* Updated: 2024-09-18T14:51:06Z | ||
* License: MIT or Apache-2.0 or GPL-2.0 or GPL-3.0 or contact us for more | ||
* Contact: Joel Parker Henderson ([email protected]) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!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 expression is Err(_)."><title>lib::assert_err - 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_err</a></h2><div class="sidebar-elems"><h2><a href="../index.html">In crate lib</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 class="mod" href="#">assert_err</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_err.rs.html#1-179">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Assert expression is Err(_).</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="prelude-ty">Result</span><(), i8> = <span class="prelude-val">Err</span>(<span class="number">1</span>); | ||
<span class="macro">assert_err!</span>(a);</code></pre></div> | ||
<h2 id="module-macros"><a class="doc-anchor" href="#module-macros">§</a>Module macros</h2> | ||
<ul> | ||
<li><a href="../macro.assert_err.html" title="macro lib::assert_err"><code>assert_err</code></a></li> | ||
<li><a href="../macro.assert_err_as_result.html" title="macro lib::assert_err_as_result"><code>assert_err_as_result</code></a></li> | ||
<li><a href="../macro.debug_assert_err.html" title="macro lib::debug_assert_err"><code>debug_assert_err</code></a></li> | ||
</ul> | ||
</div></details></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.SIDEBAR_ITEMS = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!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 expression is None."><title>lib::assert_none - 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_none</a></h2><div class="sidebar-elems"><h2><a href="../index.html">In crate lib</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 class="mod" href="#">assert_none</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_none.rs.html#1-179">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Assert expression is None.</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="prelude-ty">Option</span><i8> = Option::None; | ||
<span class="macro">assert_none!</span>(a);</code></pre></div> | ||
<h2 id="module-macros"><a class="doc-anchor" href="#module-macros">§</a>Module macros</h2> | ||
<ul> | ||
<li><a href="../macro.assert_none.html" title="macro lib::assert_none"><code>assert_none</code></a></li> | ||
<li><a href="../macro.assert_none_as_result.html" title="macro lib::assert_none_as_result"><code>assert_none_as_result</code></a></li> | ||
<li><a href="../macro.debug_assert_none.html" title="macro lib::debug_assert_none"><code>debug_assert_none</code></a></li> | ||
</ul> | ||
</div></details></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.SIDEBAR_ITEMS = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!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 expression is Ok(_)."><title>lib::assert_ok - 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_ok</a></h2><div class="sidebar-elems"><h2><a href="../index.html">In crate lib</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 class="mod" href="#">assert_ok</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_ok.rs.html#1-179">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Assert expression is Ok(_).</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="prelude-ty">Result</span><(), i8> = <span class="prelude-val">Ok</span>(()); | ||
<span class="macro">assert_ok!</span>(a);</code></pre></div> | ||
<h2 id="module-macros"><a class="doc-anchor" href="#module-macros">§</a>Module macros</h2> | ||
<ul> | ||
<li><a href="../macro.assert_ok.html" title="macro lib::assert_ok"><code>assert_ok</code></a></li> | ||
<li><a href="../macro.assert_ok_as_result.html" title="macro lib::assert_ok_as_result"><code>assert_ok_as_result</code></a></li> | ||
<li><a href="../macro.debug_assert_ok.html" title="macro lib::debug_assert_ok"><code>debug_assert_ok</code></a></li> | ||
</ul> | ||
</div></details></section></div></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
window.SIDEBAR_ITEMS = {}; |
Oops, something went wrong.