multiline_token.carbon 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // This is validating that the multi-line token's hint prints correctly.
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/parse/testdata/basics/multiline_token.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/multiline_token.carbon
  12. // --- fail_multiline_token.carbon
  13. // CHECK:STDERR: fail_multiline_token.carbon:[[@LINE+4]]:1: error: unrecognized declaration introducer [UnrecognizedDecl]
  14. // CHECK:STDERR: '''
  15. // CHECK:STDERR: ^~~
  16. // CHECK:STDERR:
  17. '''
  18. hello
  19. '''
  20. // CHECK:STDOUT: - filename: fail_multiline_token.carbon
  21. // CHECK:STDOUT: parse_tree: [
  22. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  23. // CHECK:STDOUT: {kind: 'InvalidParseStart', text: ''''
  24. // CHECK:STDOUT: hello
  25. // CHECK:STDOUT: '''', has_error: yes},
  26. // CHECK:STDOUT: {kind: 'InvalidParseSubtree', text: ''''
  27. // CHECK:STDOUT: hello
  28. // CHECK:STDOUT: '''', has_error: yes, subtree_size: 2},
  29. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  30. // CHECK:STDOUT: ]