Skip to content

Commit

Permalink
Cleanup clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyMorganz committed Nov 11, 2023
1 parent 711b0db commit c34fa41
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
56 changes: 28 additions & 28 deletions tests/test_call_parentheses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn format(paren_type: CallParenType, input: &str) -> String {
fn test_call_parens_always_handles_string_correctly() {
insta::assert_snapshot!(
format(CallParenType::Always,
r###"
r#"
local foo = require "foo"
local has_parens = require("configuration").has_parens
Expand All @@ -24,7 +24,7 @@ multi
line
string
]]
"###
"#
),
@r###"
local foo = require("foo")
Expand All @@ -44,7 +44,7 @@ string
fn test_call_parens_always_handles_table_correctly() {
insta::assert_snapshot!(
format(CallParenType::Always,
r###"
r#"
local opt = my_function {
hello = true,
}
Expand All @@ -53,7 +53,7 @@ local still_got_em = my_function({
config = true,
value = "yup",
}):method()
"###
"#
),
@r###"
local opt = my_function({
Expand All @@ -72,7 +72,7 @@ local still_got_em = my_function({
fn test_call_parens_no_single_string_handles_string_correctly() {
insta::assert_snapshot!(
format(CallParenType::NoSingleString,
r###"
r#"
local foo = require "foo"
local has_parens = require("configuration").has_parens
Expand All @@ -82,7 +82,7 @@ multi
line
string
]]
"###
"#
),
@r###"
local foo = require "foo"
Expand All @@ -102,7 +102,7 @@ string
fn test_call_parens_no_single_string_handles_table_correctly() {
insta::assert_snapshot!(
format(CallParenType::NoSingleString,
r###"
r#"
local opt = my_function {
hello = true,
}
Expand All @@ -111,7 +111,7 @@ local still_got_em = my_function({
config = true,
value = "yup",
}):method()
"###
"#
),
@r###"
local opt = my_function({
Expand All @@ -130,7 +130,7 @@ local still_got_em = my_function({
fn test_call_parens_no_single_table_handles_string_correctly() {
insta::assert_snapshot!(
format(CallParenType::NoSingleTable,
r###"
r#"
local foo = require "foo"
local has_parens = require("configuration").has_parens
Expand All @@ -140,7 +140,7 @@ multi
line
string
]]
"###
"#
),
@r###"
local foo = require("foo")
Expand All @@ -160,7 +160,7 @@ string
fn test_call_parens_no_single_table_handles_table_correctly() {
insta::assert_snapshot!(
format(CallParenType::NoSingleTable,
r###"
r#"
local opt = my_function {
hello = true,
}
Expand All @@ -169,7 +169,7 @@ local still_got_em = my_function({
config = true,
value = "yup",
}):method()
"###
"#
),
@r###"
local opt = my_function {
Expand All @@ -188,7 +188,7 @@ local still_got_em = my_function({
fn test_call_parens_none_handles_string_correctly() {
insta::assert_snapshot!(
format(CallParenType::None,
r###"
r#"
local foo = require "foo"
local has_parens = require("configuration").has_parens
Expand All @@ -198,7 +198,7 @@ multi
line
string
]]
"###
"#
),
@r###"
local foo = require "foo"
Expand All @@ -218,7 +218,7 @@ string
fn test_call_parens_none_handles_table_correctly() {
insta::assert_snapshot!(
format(CallParenType::None,
r###"
r#"
local opt = my_function {
hello = true,
}
Expand All @@ -227,7 +227,7 @@ local still_got_em = my_function({
config = true,
value = "yup",
}):method()
"###
"#
),
@r###"
local opt = my_function {
Expand All @@ -246,11 +246,11 @@ local still_got_em = my_function({
fn test_call_parens_has_no_affect_on_multi_arg_fn_calls_() {
insta::assert_snapshot!(
format(CallParenType::Always,
r###"
r#"
local opt = my_function({
hello = true,
}, "strarg", 5)
"###
"#
),
@r###"
local opt = my_function({
Expand All @@ -260,11 +260,11 @@ local opt = my_function({
);
insta::assert_snapshot!(
format(CallParenType::NoSingleTable,
r###"
r#"
local opt = my_function({
hello = true,
}, "strarg", 5)
"###
"#
),
@r###"
local opt = my_function({
Expand All @@ -274,11 +274,11 @@ local opt = my_function({
);
insta::assert_snapshot!(
format(CallParenType::None,
r###"
r#"
local opt = my_function({
hello = true,
}, "strarg", 5)
"###
"#
),
@r###"
local opt = my_function({
Expand All @@ -292,9 +292,9 @@ local opt = my_function({
fn test_call_parens_comments() {
insta::assert_snapshot!(
format(CallParenType::None,
r###"
r#"
foo("hello") -- comment
"###
"#
),
@r###"foo "hello" -- comment
"###
Expand All @@ -305,10 +305,10 @@ foo("hello") -- comment
fn test_call_parens_semicolons() {
insta::assert_snapshot!(
format(CallParenType::None,
r###"
r#"
foo"hello"; -- comment
foo{ x = y }; -- comment
"###
"#
),
@r###"
foo "hello" -- comment
Expand All @@ -321,12 +321,12 @@ foo{ x = y }; -- comment
fn test_call_parens_input() {
insta::assert_snapshot!(
format(CallParenType::Input,
r###"
r#"
require("path")
local x = New "TextLabel" {
x = game:FindFirstChild("Testing")
}
"###
"#
),
@r###"
require("path")
Expand Down
24 changes: 12 additions & 12 deletions tests/test_no_call_parens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ fn format(input: &str) -> String {
fn test_no_parens_string() {
insta::assert_snapshot!(
format(
r###"
r#"
foo"string"
"###
"#
),
@r###"foo "string"
"###
Expand All @@ -27,9 +27,9 @@ foo"string"
fn test_omit_parens_string() {
insta::assert_snapshot!(
format(
r###"
r#"
foo("string")
"###
"#
),
@r###"foo "string"
"###
Expand Down Expand Up @@ -107,9 +107,9 @@ foo{
fn test_keep_parens_binop_string() {
insta::assert_snapshot!(
format(
r###"
r#"
foo("foo" .. "bar")
"###
"#
),
@r###"foo("foo" .. "bar")
"###
Expand All @@ -120,9 +120,9 @@ foo("foo" .. "bar")
fn test_no_parens_method_chain_1() {
insta::assert_snapshot!(
format(
r###"
r#"
foo("foo"):andThen()
"###
"#
),
@r###"foo("foo"):andThen()
"###
Expand All @@ -133,11 +133,11 @@ foo("foo"):andThen()
fn test_no_parens_method_chain_2() {
insta::assert_snapshot!(
format(
r###"
r#"
Job:new({
foo = "bar"
}):sync()
"###
"#
),
@r###"
Job:new({
Expand All @@ -151,7 +151,7 @@ Job:new({
fn test_no_parens_large_example() {
insta::assert_snapshot!(
format(
r###"
r#"
local foo = require "foo"
local has_parens = require("configuration").has_parens
Expand All @@ -163,7 +163,7 @@ local still_got_em = my_function({
config = true,
value = "yup",
}):method()
"###
"#
),
@r###"
local foo = require "foo"
Expand Down
16 changes: 8 additions & 8 deletions tests/test_quote_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn format(input: &str, quote_style: QuoteStyle) -> String {
fn test_auto_prefer_double_quotes() {
insta::assert_snapshot!(
format(
r###"
r#"
local a = "foobar"
local c = 'foobar'
local d = "foo\"bar"
Expand All @@ -23,7 +23,7 @@ local f = "foo'bar"
local g = 'foo\'bar'
local h = "foo\"bar'baz"
local i = 'foo"bar\'baz'
"###,
"#,
QuoteStyle::AutoPreferDouble
),
@r###"
Expand All @@ -43,7 +43,7 @@ local i = 'foo"bar\'baz'
fn test_auto_prefer_single_quotes() {
insta::assert_snapshot!(
format(
r###"
r#"
local a = "foobar"
local c = 'foobar'
local d = "foo\"bar"
Expand All @@ -52,7 +52,7 @@ local f = "foo'bar"
local g = 'foo\'bar'
local h = "foo\"bar'baz"
local i = 'foo"bar\'baz'
"###,
"#,
QuoteStyle::AutoPreferSingle
),
@r###"
Expand All @@ -72,7 +72,7 @@ local i = 'foo"bar\'baz'
fn test_force_double_quotes() {
insta::assert_snapshot!(
format(
r###"
r#"
local a = "foobar"
local c = 'foobar'
local d = "foo\"bar"
Expand All @@ -81,7 +81,7 @@ local f = "foo'bar"
local g = 'foo\'bar'
local h = "foo\"bar'baz"
local i = 'foo"bar\'baz'
"###,
"#,
QuoteStyle::ForceDouble
),
@r###"
Expand All @@ -101,7 +101,7 @@ local i = 'foo"bar\'baz'
fn test_force_single_quotes() {
insta::assert_snapshot!(
format(
r###"
r#"
local a = "foobar"
local c = 'foobar'
local d = "foo\"bar"
Expand All @@ -110,7 +110,7 @@ local f = "foo'bar"
local g = 'foo\'bar'
local h = "foo\"bar'baz"
local i = 'foo"bar\'baz'
"###,
"#,
QuoteStyle::ForceSingle
),
@r###"
Expand Down
Loading

0 comments on commit c34fa41

Please sign in to comment.