mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 16:04:52 +01:00
Adds minimal defaults for codegen so that those tests don't need to specify the full command line. Moves driver/testdata/compile to check/testdata/basics/raw_sem_ir, which seems like it better reflects the focus. Removes the textual IR test because we have plenty of those now. Moves a multiline token diagnostic test to parse because (a) diagnostics doesn't have other tests and (b) this is really testing the way that parse structures the location. Drops `--include-diagnostic-kind` from some driver tests that aren't testing a diagnostic, so the flag felt a bit like noise (even before this change, there are a few tests that don't specify it because they're not intended to test an emitted diagnostic, just high-level diagnostic behaviors). Adds some comments to reflect my understanding of why a test exists, when I was pausing to think about it. Modifies the stdin test to do more dumps; which happens to expose we currently misbehave.
34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// This is validating that the multi-line token's hint prints correctly.
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/parse/testdata/basics/multiline_token.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/multiline_token.carbon
|
|
|
|
// --- fail_multiline_token.carbon
|
|
|
|
// CHECK:STDERR: fail_multiline_token.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer [UnrecognizedDecl]
|
|
// CHECK:STDERR: '''
|
|
// CHECK:STDERR: ^~~
|
|
// CHECK:STDERR:
|
|
'''
|
|
hello
|
|
'''
|
|
|
|
// CHECK:STDOUT: - filename: fail_multiline_token.carbon
|
|
// CHECK:STDOUT: parse_tree: [
|
|
// CHECK:STDOUT: {kind: 'FileStart', text: ''},
|
|
// CHECK:STDOUT: {kind: 'InvalidParseStart', text: ''''
|
|
// CHECK:STDOUT: hello
|
|
// CHECK:STDOUT: '''', has_error: yes},
|
|
// CHECK:STDOUT: {kind: 'InvalidParseSubtree', text: ''''
|
|
// CHECK:STDOUT: hello
|
|
// CHECK:STDOUT: '''', has_error: yes, subtree_size: 2},
|
|
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
|
// CHECK:STDOUT: ]
|