Skip to content

Commit

Permalink
Merge pull request #11 from dtolnay/test
Browse files Browse the repository at this point in the history
Turn tests module into an integration test
  • Loading branch information
dtolnay committed Apr 17, 2024
2 parents a4db501 + 0ea7f8b commit ba04708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
mod parse;
mod render;
mod string;
#[cfg(test)]
mod tests;
mod write;

use crate::string::{EnvStr, EnvString};
Expand Down
8 changes: 5 additions & 3 deletions src/tests.rs → tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::{
#![allow(clippy::too_many_lines)]

use rustflags::{
Color, CrateType, Emit, ErrorFormat, Flag, LibraryKind, LinkKind, LinkModifier,
LinkModifierPrefix, LintLevel,
};
Expand All @@ -7,7 +9,7 @@ use std::path::PathBuf;

#[track_caller]
fn test(encoded: &str, expected: &[Flag]) {
let mut iterator = crate::from_encoded(OsStr::new(encoded));
let mut iterator = rustflags::from_encoded(OsStr::new(encoded));

let mut flags = Vec::new();
for expected in expected {
Expand All @@ -21,7 +23,7 @@ fn test(encoded: &str, expected: &[Flag]) {
assert_eq!(None, iterator.next());

let re_encoded = flags.join(OsStr::new("\x1F"));
let mut iterator = crate::from_encoded(&re_encoded);
let mut iterator = rustflags::from_encoded(&re_encoded);

for expected in expected {
assert_eq!(Some(expected), iterator.next().as_ref());
Expand Down

0 comments on commit ba04708

Please sign in to comment.