fail_incomplete.carbon 1.7 KB

1234567891011121314151617181920212223242526272829303132
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon
  10. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: ERROR: `constraint` introducer should be followed by a name.
  11. // CHECK:STDERR: constraint "Foo"
  12. // CHECK:STDERR: ^~~~~
  13. // CHECK:STDERR:
  14. constraint "Foo"
  15. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: ERROR: `constraint` introducer should be followed by a name.
  16. // CHECK:STDERR: constraint
  17. // CHECK:STDERR: ^~~~~~~~~~
  18. constraint
  19. // CHECK:STDOUT: - filename: fail_incomplete.carbon
  20. // CHECK:STDOUT: parse_tree: [
  21. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  22. // CHECK:STDOUT: {kind: 'NamedConstraintIntroducer', text: 'constraint'},
  23. // CHECK:STDOUT: {kind: 'InvalidParse', text: '"Foo"', has_error: yes},
  24. // CHECK:STDOUT: {kind: 'NamedConstraintDecl', text: '"Foo"', has_error: yes, subtree_size: 3},
  25. // CHECK:STDOUT: {kind: 'NamedConstraintIntroducer', text: 'constraint'},
  26. // CHECK:STDOUT: {kind: 'InvalidParse', text: '', has_error: yes},
  27. // CHECK:STDOUT: {kind: 'NamedConstraintDecl', text: 'constraint', has_error: yes, subtree_size: 3},
  28. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  29. // CHECK:STDOUT: ]