Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vulpesx committed Apr 27, 2024
1 parent 4589333 commit 633308d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ mod tests {
.placeholder("Placeholder");

assert_eq!(
" Title\n Description\n $ Placeholder",
" Title\n Description\n $ Placeholder\n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -509,7 +509,7 @@ mod tests {
let mut input = Input::new("Title");

assert_eq!(
" Title\n > ",
" Title\n > \n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -519,7 +519,7 @@ mod tests {
let mut input = Input::new("Title").description("Description");

assert_eq!(
" Title\n Description\n > ",
" Title\n Description\n > \n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -529,7 +529,7 @@ mod tests {
let mut input = Input::new("Title").prompt("$ ");

assert_eq!(
" Title\n $ ",
" Title\n $ \n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -539,7 +539,7 @@ mod tests {
let mut input = Input::new("Title").placeholder("Placeholder");

assert_eq!(
" Title\n > Placeholder",
" Title\n > Placeholder\n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -553,7 +553,7 @@ mod tests {
.inline(true);

assert_eq!(
" Title?Description.Prompt:Placeholder",
" Title?Description.Prompt:Placeholder\n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -567,14 +567,14 @@ mod tests {
input.input = "".to_string();
input.validate().unwrap();
assert_eq!(
" Title\n Description\n > \n\n * Name cannot be empty",
" Title\n Description\n > \n\n * Name cannot be empty\n",
without_ansi(input.render().unwrap().as_str())
);

input.input = "non empty".to_string();
input.validate().unwrap();
assert_eq!(
" Title\n Description\n > non empty",
" Title\n Description\n > non empty\n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand All @@ -589,14 +589,14 @@ mod tests {
input.input = "".to_string();
input.validate().unwrap();
assert_eq!(
" Title?Description.> \n\n * Name cannot be empty",
" Title?Description.> \n\n * Name cannot be empty\n",
without_ansi(input.render().unwrap().as_str())
);

input.input = "non empty".to_string();
input.validate().unwrap();
assert_eq!(
" Title?Description.> non empty",
" Title?Description.> non empty\n",
without_ansi(input.render().unwrap().as_str())
);
}
Expand Down

0 comments on commit 633308d

Please sign in to comment.