From afe585bdd4472f7e1c30f35b9f69902c9d8e674b Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Tue, 12 Nov 2024 08:12:23 -0800 Subject: [PATCH] Duplicate a unit test into docs. --- docs_src/dslx_std.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs_src/dslx_std.md b/docs_src/dslx_std.md index e0223dad51..6705387f59 100644 --- a/docs_src/dslx_std.md +++ b/docs_src/dslx_std.md @@ -1197,6 +1197,17 @@ pub fn distinct(items: xN[S][N][COUNT], valid: bool Returns whether all the `items` are distinct (i.e. there are no duplicate items) after the `valid` mask is applied. +```dslx +import std; + +#[test] +fn test_distinct_with_invalid() { + let items = u8[4]:[1, 2, 3, 1]; + let valid = bool[4]:[true, true, true, false]; + assert_eq(std::distinct(items, valid), true); +} +``` + ## `import acm_random` Port of