Skip to content

Commit 77a8f36

Browse files
Move tests from src to tests
This serves to enforce that the tests are only using the public API of the library.
1 parent 9cb3d5e commit 77a8f36

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ use core::{ffi::*, fmt};
117117

118118
pub mod output;
119119
mod parser;
120-
#[cfg(test)]
121-
mod tests;
122120
use argument::*;
123121
pub use parser::format;
124122
pub mod argument {

src/tests.rs renamed to tests/tests.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![feature(c_variadic)]
2+
13
use core::{ffi::*, ptr::null_mut};
24

35
extern "C" {
@@ -7,19 +9,19 @@ extern "C" {
79

810
unsafe extern "C" fn rust_fmt(str: *const u8, mut args: ...) -> Box<(c_int, String)> {
911
let mut s = String::new();
10-
let bytes_written = crate::format(
12+
let bytes_written = printf_compat::format(
1113
str as _,
1214
args.clone().as_va_list(),
13-
crate::output::fmt_write(&mut s),
15+
printf_compat::output::fmt_write(&mut s),
1416
);
1517
assert!(bytes_written >= 0);
1618
let mut s2 = std::io::Cursor::new(vec![]);
1719
assert_eq!(
1820
bytes_written,
19-
crate::format(
21+
printf_compat::format(
2022
str as _,
2123
args.as_va_list(),
22-
crate::output::io_write(&mut s2),
24+
printf_compat::output::io_write(&mut s2),
2325
)
2426
);
2527
assert_eq!(s.as_bytes(), s2.get_ref());

0 commit comments

Comments
 (0)