Skip to content

Commit

Permalink
Duplicate a unit test into docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleary committed Nov 12, 2024
1 parent f5a3ec6 commit afe585b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs_src/dslx_std.md
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,17 @@ pub fn distinct<COUNT: u32, N: u32, S: bool>(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
Expand Down

0 comments on commit afe585b

Please sign in to comment.