Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Aug 13, 2024
1 parent fc0b952 commit bde602d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dprint_plugin/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn integration_with_dprint_ts_snapshot() {
.map_err(Error::from)
} else if ext == "json" {
dprint_plugin_json::format_text(
path,
&Path::new("file").with_extension(ext),
code,
&dprint_plugin_json::configuration::resolve_config(
additional_config,
Expand All @@ -49,7 +49,7 @@ fn integration_with_dprint_ts_snapshot() {
})
} else {
dprint_plugin_typescript::format_text(
path,
&Path::new("file").with_extension(ext),
code.to_owned(),
&dprint_plugin_typescript::configuration::resolve_config(
additional_config,
Expand Down Expand Up @@ -120,7 +120,7 @@ fn integration_with_biome_snapshot() {
.map_err(Error::from)
} else {
dprint_plugin_biome::format_text(
path,
&Path::new("file").with_extension(ext),
code,
&serde_json::to_value(additional_config)
.and_then(serde_json::from_value)
Expand Down
6 changes: 3 additions & 3 deletions markup_fmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ assert_eq!("<div class=\"container\"></div>\n", &format_text(
"<div class=container></div>",
Language::Html,
&options,
|_, code, _| Ok::<_, std::convert::Infallible>(code.into()),
|code, _| Ok::<_, std::convert::Infallible>(code.into()),
).unwrap());
```

Expand All @@ -30,7 +30,7 @@ assert!(matches!(
"<div>",
Language::Html,
&options,
|_, code, _| Ok::<_, std::convert::Infallible>(code.into()),
|code, _| Ok::<_, std::convert::Infallible>(code.into()),
).unwrap_err(),
FormatError::Syntax(SyntaxError { .. })
));
Expand All @@ -50,7 +50,7 @@ assert!(matches!(
"<script>a</script>",
Language::Html,
&options,
|_, _, _| Err(ExternalFormatterError),
|_, _| Err(ExternalFormatterError),
).unwrap_err(),
FormatError::External(errors) if !errors.is_empty()
));
Expand Down
2 changes: 1 addition & 1 deletion markup_fmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use tiny_pretty::{IndentKind, PrintOptions};
/// code,
/// Language::Html,
/// &Default::default(),
/// |_, code, _| Ok::<_, std::convert::Infallible>(code.into()),
/// |code, _| Ok::<_, std::convert::Infallible>(code.into()),
/// ).unwrap();
/// ```
///
Expand Down
4 changes: 2 additions & 2 deletions markup_fmt/tests/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ fn run_format_test(
options: &FormatOptions,
language: Language,
) -> String {
let output = format_text(&input, language.clone(), &options, |_, code, _| {
let output = format_text(&input, language.clone(), &options, |code, _| {
Ok::<_, ()>(code.into())
})
.map_err(|err| format!("failed to format '{}': {:?}", path.display(), err))
.unwrap();
let regression_format = format_text(&output, language, &options, |_, code, _| {
let regression_format = format_text(&output, language, &options, |code, _| {
Ok::<_, ()>(code.into())
})
.map_err(|err| {
Expand Down

0 comments on commit bde602d

Please sign in to comment.