Skip to content

Commit 41ed301

Browse files
cursoragentechobt
andcommitted
test(plugins): match wee_alloc usage, not warning comments
Generator templates mention wee_alloc only as a crate to avoid. Assert on wee_alloc:: / wee_alloc = so those comments do not fail tests. Co-authored-by: Mathis <echobt@users.noreply.github.com>
1 parent 242f1de commit 41ed301

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/cortex-cli/src/plugin_cmd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3504,7 +3504,7 @@ mod tests {
35043504
"Rust code should use std so the default allocator is available"
35053505
);
35063506
assert!(
3507-
!code.contains("wee_alloc"),
3507+
!code.contains("wee_alloc::") && !code.contains("wee_alloc ="),
35083508
"Rust code should not use unmaintained wee_alloc"
35093509
);
35103510
}
@@ -3557,7 +3557,7 @@ mod tests {
35573557
"generated code should use the default Rust allocator"
35583558
);
35593559
assert!(
3560-
!code.contains("wee_alloc"),
3560+
!code.contains("wee_alloc::") && !code.contains("wee_alloc ="),
35613561
"generated code must not use unmaintained wee_alloc"
35623562
);
35633563
}

src/cortex-plugins/tests/integration_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ mod sdk_tests {
143143
"Should use std (default Rust allocator)"
144144
);
145145
assert!(
146-
!code.contains("wee_alloc"),
146+
!code.contains("wee_alloc::") && !code.contains("wee_alloc ="),
147147
"Should not depend on unmaintained wee_alloc"
148148
);
149149
assert!(
@@ -218,7 +218,7 @@ mod sdk_tests {
218218
"Should have register_widget"
219219
);
220220
assert!(
221-
!code.contains("wee_alloc"),
221+
!code.contains("wee_alloc::") && !code.contains("wee_alloc ="),
222222
"Advanced template must not use wee_alloc"
223223
);
224224
assert!(

0 commit comments

Comments
 (0)