mirror of
https://github.com/bspeice/qadapt
synced 2024-11-14 18:18:08 -05:00
27 lines
344 B
Rust
27 lines
344 B
Rust
|
extern crate qadapt;
|
||
|
|
||
|
use qadapt::allocate_panic;
|
||
|
|
||
|
|
||
|
#[allocate_panic]
|
||
|
fn allocates() {
|
||
|
let _v: Vec<()> = Vec::with_capacity(1);
|
||
|
}
|
||
|
|
||
|
#[allocate_panic]
|
||
|
fn no_allocate() {
|
||
|
let _v: Vec<()> = Vec::with_capacity(0);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn test_no_allocate() {
|
||
|
no_allocate();
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
#[test]
|
||
|
#[should_panic]
|
||
|
fn test_allocates() {
|
||
|
allocates();
|
||
|
}
|
||
|
*/
|