diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/tools/rustfmt/tests/writemode/target | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
5 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/writemode/target/checkstyle.xml b/src/tools/rustfmt/tests/writemode/target/checkstyle.xml new file mode 100644 index 000000000..05bc3a252 --- /dev/null +++ b/src/tools/rustfmt/tests/writemode/target/checkstyle.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?> +<checkstyle version="4.3"><file name="tests/writemode/source/fn-single-line.rs"><error line="5" severity="warning" message="Should be `fn foo_expr() { 1 }`" /><error line="7" severity="warning" message="Should be `fn foo_stmt() { foo(); }`" /><error line="9" severity="warning" message="Should be `fn foo_decl_local() { let z = 5; }`" /><error line="11" severity="warning" message="Should be `fn foo_decl_item(x: &mut i32) { x = 3; }`" /><error line="13" severity="warning" message="Should be `fn empty() {}`" /><error line="15" severity="warning" message="Should be `fn foo_return() -> String { "yay" }`" /><error line="17" severity="warning" message="Should be `fn foo_where() -> T`" /><error line="18" severity="warning" message="Should be `where`" /><error line="19" severity="warning" message="Should be ` T: Sync,`" /><error line="20" severity="warning" message="Should be `{`" /><error line="55" severity="warning" message="Should be `fn lots_of_space() { 1 }`" /><error line="60" severity="warning" message="Should be ` fn dummy(&self) {}`" /><error line="63" severity="warning" message="Should be `trait CoolerTypes {`" /><error line="64" severity="warning" message="Should be ` fn dummy(&self) {}`" /><error line="67" severity="warning" message="Should be `fn Foo<T>()`" /><error line="68" severity="warning" message="Should be `where`" /><error line="69" severity="warning" message="Should be ` T: Bar,`" /><error line="70" severity="warning" message="Should be `{`" /></file></checkstyle> diff --git a/src/tools/rustfmt/tests/writemode/target/modified.txt b/src/tools/rustfmt/tests/writemode/target/modified.txt new file mode 100644 index 000000000..5c0539a66 --- /dev/null +++ b/src/tools/rustfmt/tests/writemode/target/modified.txt @@ -0,0 +1,5 @@ +4 4 1 +fn blah() {} +10 5 2 +#[cfg(a, b)] +fn main() {} diff --git a/src/tools/rustfmt/tests/writemode/target/output.json b/src/tools/rustfmt/tests/writemode/target/output.json new file mode 100644 index 000000000..d8b5467ee --- /dev/null +++ b/src/tools/rustfmt/tests/writemode/target/output.json @@ -0,0 +1 @@ +[{"name":"tests/writemode/source/json.rs","mismatches":[{"original_begin_line":5,"original_end_line":7,"expected_begin_line":5,"expected_end_line":5,"original":"fn foo_expr() {\n 1\n}\n","expected":"fn foo_expr() { 1 }\n"},{"original_begin_line":9,"original_end_line":11,"expected_begin_line":7,"expected_end_line":7,"original":"fn foo_stmt() {\n foo();\n}\n","expected":"fn foo_stmt() { foo(); }\n"},{"original_begin_line":13,"original_end_line":15,"expected_begin_line":9,"expected_end_line":9,"original":"fn foo_decl_local() {\n let z = 5;\n }\n","expected":"fn foo_decl_local() { let z = 5; }\n"},{"original_begin_line":17,"original_end_line":19,"expected_begin_line":11,"expected_end_line":11,"original":"fn foo_decl_item(x: &mut i32) {\n x = 3;\n}\n","expected":"fn foo_decl_item(x: &mut i32) { x = 3; }\n"},{"original_begin_line":21,"original_end_line":21,"expected_begin_line":13,"expected_end_line":13,"original":" fn empty() {\n","expected":"fn empty() {}\n"},{"original_begin_line":23,"original_end_line":23,"expected_begin_line":15,"expected_end_line":15,"original":"}\n","expected":"fn foo_return() -> String { \"yay\" }\n"},{"original_begin_line":25,"original_end_line":29,"expected_begin_line":17,"expected_end_line":20,"original":"fn foo_return() -> String {\n \"yay\"\n}\n\nfn foo_where() -> T where T: Sync {\n","expected":"fn foo_where() -> T\nwhere\n T: Sync,\n{\n"},{"original_begin_line":64,"original_end_line":66,"expected_begin_line":55,"expected_end_line":55,"original":"fn lots_of_space () {\n 1 \n}\n","expected":"fn lots_of_space() { 1 }\n"},{"original_begin_line":71,"original_end_line":72,"expected_begin_line":60,"expected_end_line":60,"original":" fn dummy(&self) {\n }\n","expected":" fn dummy(&self) {}\n"},{"original_begin_line":75,"original_end_line":75,"expected_begin_line":63,"expected_end_line":64,"original":"trait CoolerTypes { fn dummy(&self) { \n","expected":"trait CoolerTypes {\n fn dummy(&self) {}\n"},{"original_begin_line":77,"original_end_line":77,"expected_begin_line":66,"expected_end_line":66,"original":"}\n","expected":""},{"original_begin_line":79,"original_end_line":79,"expected_begin_line":67,"expected_end_line":70,"original":"fn Foo<T>() where T: Bar {\n","expected":"fn Foo<T>()\nwhere\n T: Bar,\n{\n"}]}] diff --git a/src/tools/rustfmt/tests/writemode/target/stdin.json b/src/tools/rustfmt/tests/writemode/target/stdin.json new file mode 100644 index 000000000..dbf2c4863 --- /dev/null +++ b/src/tools/rustfmt/tests/writemode/target/stdin.json @@ -0,0 +1 @@ +[{"name":"<stdin>","mismatches":[{"original_begin_line":1,"original_end_line":6,"expected_begin_line":1,"expected_end_line":2,"original":"\nfn\n some( )\n{\n}\nfn main () {}\n","expected":"fn some() {}\nfn main() {}\n"}]}] diff --git a/src/tools/rustfmt/tests/writemode/target/stdin.xml b/src/tools/rustfmt/tests/writemode/target/stdin.xml new file mode 100644 index 000000000..a7301bbc5 --- /dev/null +++ b/src/tools/rustfmt/tests/writemode/target/stdin.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?>
+<checkstyle version="4.3"><file name="<stdin>"><error line="1" severity="warning" message="Should be `fn some() {}`" /><error line="2" severity="warning" message="Should be `fn main() {}`" /></file></checkstyle>
|