feat: add c

This commit is contained in:
2020-11-29 16:10:48 +08:00
parent a5571a138b
commit d1db369f44
4 changed files with 379 additions and 1 deletions

22
__ffi/c/src/main.rs Normal file
View File

@@ -0,0 +1,22 @@
use inline_c::assert_c;
fn main() {
println!("Hello, world!");
}
#[test]
fn test_stdout() {
(assert_c! {
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
})
.success()
.stdout("Hello, World!");
}