From 958fb8e529bad729aa2864b3b9ad92e8d748dc2e Mon Sep 17 00:00:00 2001 From: josh11b Date: Tue, 19 Apr 2022 16:10:11 -0700 Subject: [PATCH] Format carbon test files (#1197) --- executable_semantics/testdata/class/class_function.carbon | 1 - .../testdata/class/class_function_from_instance.carbon | 1 - .../testdata/class/class_function_value.carbon | 1 - .../testdata/class/fail_method_from_class.carbon | 3 +-- executable_semantics/testdata/class/method.carbon | 1 - .../testdata/class/method_call_method.carbon | 1 - .../testdata/generic_class/fail_bad_parameter_type.carbon | 3 +-- .../testdata/generic_class/generic_point.carbon | 1 - .../testdata/interface/class_function.carbon | 6 +++--- .../testdata/interface/external_impl_point_vector.carbon | 4 ++-- .../testdata/interface/fail_impl_bad_member.carbon | 4 ++-- .../testdata/interface/fail_impl_missing_member.carbon | 2 +- .../interface/fail_interface_missing_member.carbon | 2 +- .../testdata/interface/generic_call_generic.carbon | 4 ++-- .../testdata/interface/generic_with_two_params.carbon | 8 ++++---- .../testdata/interface/tuple_vector_add_scale.carbon | 4 ++-- .../testdata/interface/vector_point_add_scale.carbon | 4 ++-- executable_semantics/testdata/let/fail_method_args.carbon | 3 +-- 18 files changed, 22 insertions(+), 31 deletions(-) diff --git a/executable_semantics/testdata/class/class_function.carbon b/executable_semantics/testdata/class/class_function.carbon index 94b451c6a09f..9e8916788d3b 100644 --- a/executable_semantics/testdata/class/class_function.carbon +++ b/executable_semantics/testdata/class/class_function.carbon @@ -12,7 +12,6 @@ package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; } diff --git a/executable_semantics/testdata/class/class_function_from_instance.carbon b/executable_semantics/testdata/class/class_function_from_instance.carbon index 1131b5642207..0acb8b4911d9 100644 --- a/executable_semantics/testdata/class/class_function_from_instance.carbon +++ b/executable_semantics/testdata/class/class_function_from_instance.carbon @@ -12,7 +12,6 @@ package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; } diff --git a/executable_semantics/testdata/class/class_function_value.carbon b/executable_semantics/testdata/class/class_function_value.carbon index 3661ca1e1e75..a158afe64d24 100644 --- a/executable_semantics/testdata/class/class_function_value.carbon +++ b/executable_semantics/testdata/class/class_function_value.carbon @@ -12,7 +12,6 @@ package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; } diff --git a/executable_semantics/testdata/class/fail_method_from_class.carbon b/executable_semantics/testdata/class/fail_method_from_class.carbon index 395f0934bf79..bcedd282c1ff 100644 --- a/executable_semantics/testdata/class/fail_method_from_class.carbon +++ b/executable_semantics/testdata/class/fail_method_from_class.carbon @@ -7,12 +7,11 @@ // RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s // AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/class/fail_method_from_class.carbon:29: GetX is not a class function +// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/class/fail_method_from_class.carbon:28: GetX is not a class function package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; } diff --git a/executable_semantics/testdata/class/method.carbon b/executable_semantics/testdata/class/method.carbon index 3914057a45f9..214a3388f957 100644 --- a/executable_semantics/testdata/class/method.carbon +++ b/executable_semantics/testdata/class/method.carbon @@ -12,7 +12,6 @@ package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; } diff --git a/executable_semantics/testdata/class/method_call_method.carbon b/executable_semantics/testdata/class/method_call_method.carbon index 86837d9b838e..e9ca71abe1bf 100644 --- a/executable_semantics/testdata/class/method_call_method.carbon +++ b/executable_semantics/testdata/class/method_call_method.carbon @@ -12,7 +12,6 @@ package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; } diff --git a/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon b/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon index 802d2c1c0607..f45787715719 100644 --- a/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon +++ b/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon @@ -7,12 +7,11 @@ // RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s // AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon:16: unexpected type of deduced parameter i32 +// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/generic_class/fail_bad_parameter_type.carbon:15: unexpected type of deduced parameter i32 package ExecutableSemanticsTest api; class Point(T:! i32) { - fn Origin(zero: T) -> Point(T) { return {.x = zero, .y = zero}; } diff --git a/executable_semantics/testdata/generic_class/generic_point.carbon b/executable_semantics/testdata/generic_class/generic_point.carbon index 2b86c09155cc..b7005f44229d 100644 --- a/executable_semantics/testdata/generic_class/generic_point.carbon +++ b/executable_semantics/testdata/generic_class/generic_point.carbon @@ -12,7 +12,6 @@ package ExecutableSemanticsTest api; class Point(T:! Type) { - fn Origin(zero: T) -> Point(T) { return {.x = zero, .y = zero}; } diff --git a/executable_semantics/testdata/interface/class_function.carbon b/executable_semantics/testdata/interface/class_function.carbon index a65779041559..6d9127201b02 100644 --- a/executable_semantics/testdata/interface/class_function.carbon +++ b/executable_semantics/testdata/interface/class_function.carbon @@ -22,13 +22,13 @@ class Point { var y: i32; impl Point as Vector { fn Zero() -> Point { - return {.x = 0, .y = 0}; + return {.x = 0, .y = 0}; } fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point](v: i32) -> Point { - return {.x = me.x * v, .y = me.y * v}; + return {.x = me.x * v, .y = me.y * v}; } } } diff --git a/executable_semantics/testdata/interface/external_impl_point_vector.carbon b/executable_semantics/testdata/interface/external_impl_point_vector.carbon index 9cabd25b8c3a..168e649803e9 100644 --- a/executable_semantics/testdata/interface/external_impl_point_vector.carbon +++ b/executable_semantics/testdata/interface/external_impl_point_vector.carbon @@ -23,10 +23,10 @@ class Point { external impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point](v: i32) -> Point { - return {.x = me.x * v, .y = me.y * v}; + return {.x = me.x * v, .y = me.y * v}; } } diff --git a/executable_semantics/testdata/interface/fail_impl_bad_member.carbon b/executable_semantics/testdata/interface/fail_impl_bad_member.carbon index c6aefff063a9..a80465d8915e 100644 --- a/executable_semantics/testdata/interface/fail_impl_bad_member.carbon +++ b/executable_semantics/testdata/interface/fail_impl_bad_member.carbon @@ -21,10 +21,10 @@ class Point { var y: i32; impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point](v: i32) -> i32 { - return 0; + return 0; } } } diff --git a/executable_semantics/testdata/interface/fail_impl_missing_member.carbon b/executable_semantics/testdata/interface/fail_impl_missing_member.carbon index 8cb6692be1ed..b082e30909b1 100644 --- a/executable_semantics/testdata/interface/fail_impl_missing_member.carbon +++ b/executable_semantics/testdata/interface/fail_impl_missing_member.carbon @@ -21,7 +21,7 @@ class Point { var y: i32; impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } } } diff --git a/executable_semantics/testdata/interface/fail_interface_missing_member.carbon b/executable_semantics/testdata/interface/fail_interface_missing_member.carbon index 35d5f16403b6..a89be1d0eee8 100644 --- a/executable_semantics/testdata/interface/fail_interface_missing_member.carbon +++ b/executable_semantics/testdata/interface/fail_interface_missing_member.carbon @@ -24,7 +24,7 @@ class Point { var y: i32; impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } } } diff --git a/executable_semantics/testdata/interface/generic_call_generic.carbon b/executable_semantics/testdata/interface/generic_call_generic.carbon index 05d84d194d65..34ba94208394 100644 --- a/executable_semantics/testdata/interface/generic_call_generic.carbon +++ b/executable_semantics/testdata/interface/generic_call_generic.carbon @@ -21,10 +21,10 @@ class Point { var y: i32; impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point](v: i32) -> Point { - return {.x = me.x * v, .y = me.y * v}; + return {.x = me.x * v, .y = me.y * v}; } } } diff --git a/executable_semantics/testdata/interface/generic_with_two_params.carbon b/executable_semantics/testdata/interface/generic_with_two_params.carbon index fc0b3d112613..ff1a37a5861e 100644 --- a/executable_semantics/testdata/interface/generic_with_two_params.carbon +++ b/executable_semantics/testdata/interface/generic_with_two_params.carbon @@ -21,10 +21,10 @@ class Point1 { var y: i32; impl Point1 as Vector { fn Add[me: Point1](b: Point1) -> Point1 { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point1](v: i32) -> Point1 { - return {.x = me.x * v, .y = me.y * v}; + return {.x = me.x * v, .y = me.y * v}; } } } @@ -34,10 +34,10 @@ class Point2 { var y: i32; impl Point2 as Vector { fn Add[me: Point2](b: Point2) -> Point2 { - return {.x = me.x + b.x + 1, .y = me.y + b.y + 1}; + return {.x = me.x + b.x + 1, .y = me.y + b.y + 1}; } fn Scale[me: Point2](v: i32) -> Point2 { - return {.x = me.x * v * 2, .y = me.y * v * 2}; + return {.x = me.x * v * 2, .y = me.y * v * 2}; } } } diff --git a/executable_semantics/testdata/interface/tuple_vector_add_scale.carbon b/executable_semantics/testdata/interface/tuple_vector_add_scale.carbon index 8382f172e886..cb48cb545b62 100644 --- a/executable_semantics/testdata/interface/tuple_vector_add_scale.carbon +++ b/executable_semantics/testdata/interface/tuple_vector_add_scale.carbon @@ -21,10 +21,10 @@ class Point { var y: i32; impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point](v: i32) -> Point { - return {.x = me.x * v, .y = me.y * v}; + return {.x = me.x * v, .y = me.y * v}; } } } diff --git a/executable_semantics/testdata/interface/vector_point_add_scale.carbon b/executable_semantics/testdata/interface/vector_point_add_scale.carbon index 79342883fa73..b028d2452568 100644 --- a/executable_semantics/testdata/interface/vector_point_add_scale.carbon +++ b/executable_semantics/testdata/interface/vector_point_add_scale.carbon @@ -21,10 +21,10 @@ class Point { var y: i32; impl Point as Vector { fn Add[me: Point](b: Point) -> Point { - return {.x = me.x + b.x, .y = me.y + b.y}; + return {.x = me.x + b.x, .y = me.y + b.y}; } fn Scale[me: Point](v: i32) -> Point { - return {.x = me.x * v, .y = me.y * v}; + return {.x = me.x * v, .y = me.y * v}; } } } diff --git a/executable_semantics/testdata/let/fail_method_args.carbon b/executable_semantics/testdata/let/fail_method_args.carbon index f0ab234eb024..15689617b502 100644 --- a/executable_semantics/testdata/let/fail_method_args.carbon +++ b/executable_semantics/testdata/let/fail_method_args.carbon @@ -7,12 +7,11 @@ // RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \ // RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s // AUTOUPDATE: %{executable_semantics} %s -// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_method_args.carbon:21: Cannot assign to rvalue 'x' +// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/let/fail_method_args.carbon:20: Cannot assign to rvalue 'x' package ExecutableSemanticsTest api; class Point { - fn Origin() -> Point { return {.x = 0, .y = 0}; }