Skip to content

Commit

Permalink
[wgsl-in] Avoid conditional derive for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Aug 11, 2023
1 parent 470e4de commit 5a44632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/front/wgsl/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ pub enum InvalidAssignmentType {
}

#[derive(Clone, Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub enum Error<'a> {
Unexpected(Span, ExpectedToken<'a>),
UnexpectedComponents(Span),
Expand Down
7 changes: 4 additions & 3 deletions src/front/wgsl/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,12 @@ fn parse_repeated_attributes() {
let name_length = attribute.rfind('(').unwrap_or(attribute.len()) as u32;
let span_start = shader.rfind(attribute).unwrap() as u32;
let span_end = span_start + name_length;
let expected_span = Span::new(span_start, span_end);

let result = Frontend::new().inner(&shader);
assert_eq!(
assert!(matches!(
result.unwrap_err(),
Error::RepeatedAttribute(Span::new(span_start, span_end))
);
Error::RepeatedAttribute(span) if span == expected_span
));
}
}

0 comments on commit 5a44632

Please sign in to comment.