mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Provide local paths for file tests. (#2830)
The intent of this change is that instead of paths looking like `explorer/testdata/foo/bar.carbon` (repo-relative), they're now just `bar.carbon` (local). The consequence is that paths should be a bit more durable in various environments, and just paths should be shorter and easier to read. The explorer's prelude is an exception to this since it comes from data, rather than being the test target. Due to the change in approaches, it needs the regex again. Uses #2829
This commit is contained in:
@@ -129,24 +129,24 @@ fn Run1(a: i32) {}
|
||||
fn Run2(a: i32, b: i32) {}
|
||||
|
||||
fn Main() {
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE-6]]:1: Callable cannot be used: Received 1 argument(s), but require 0 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-6]]:1: Callable cannot be used: Received 1 argument(s), but require 0 argument(s).
|
||||
Run0(1);
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE-9]]:1: Callable cannot be used: Received 2 argument(s), but require 0 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-9]]:1: Callable cannot be used: Received 2 argument(s), but require 0 argument(s).
|
||||
Run0(0, 1);
|
||||
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE-12]]:1: Callable cannot be used: Received 0 argument(s), but require 1 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-12]]:1: Callable cannot be used: Received 0 argument(s), but require 1 argument(s).
|
||||
Run1();
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE-15]]:1: Callable cannot be used: Received 2 argument(s), but require 1 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-15]]:1: Callable cannot be used: Received 2 argument(s), but require 1 argument(s).
|
||||
Run1(0, 1);
|
||||
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE-18]]:1: Callable cannot be used: Received 0 argument(s), but require 2 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-18]]:1: Callable cannot be used: Received 0 argument(s), but require 2 argument(s).
|
||||
Run2();
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_count.carbon:[[@LINE-21]]:1: Callable cannot be used: Received 1 argument(s), but require 2 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+2]]:7: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-21]]:1: Callable cannot be used: Received 1 argument(s), but require 2 argument(s).
|
||||
Run2(0);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
fn Run(a: i32) {}
|
||||
|
||||
fn Main() {
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_type.carbon:[[@LINE+2]]:6: No matching callable was found.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_param_type.carbon:[[@LINE-4]]:1: Callable cannot be used: Cannot implicityly convert argument 0 from `f64` to `i32`.
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+2]]:6: No matching callable was found.
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE-4]]:1: Callable cannot be used: Cannot implicityly convert argument 0 from `f64` to `i32`.
|
||||
Run(1.0);
|
||||
}
|
||||
|
||||
+1
-1
@@ -57,6 +57,6 @@
|
||||
fn Foo() -> f64 { return 1.0; }
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon:[[@LINE+1]]:21: Cannot implicitly convert from `f64` to `i32`.
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+1]]:21: Cannot implicitly convert from `f64` to `i32`.
|
||||
var x: i32 = Foo();
|
||||
}
|
||||
|
||||
+2
-2
@@ -44,6 +44,6 @@
|
||||
// CHECK:STDOUT: ],
|
||||
// CHECK:STDOUT: ]
|
||||
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/definition/fail_param_name_conflict.carbon:[[@LINE+2]]:16: Redefining a in the same scope.
|
||||
// CHECK:STDERR: toolchain/semantics/testdata/function/definition/fail_param_name_conflict.carbon:[[@LINE+1]]:8: Previous definition is here.
|
||||
// CHECK:STDERR: fail_param_name_conflict.carbon:[[@LINE+2]]:16: Redefining a in the same scope.
|
||||
// CHECK:STDERR: fail_param_name_conflict.carbon:[[@LINE+1]]:8: Previous definition is here.
|
||||
fn Bar(a: i32, a: i32) {}
|
||||
|
||||
Reference in New Issue
Block a user