Files
carbon-lang/testing/file_test/testdata/replace_content.carbon
T
Richard Smith ad84e71acd Avoid non-UTF8-encoded test files. (#5965)
Add a content keyword to file_test, `[[@0xAB]]`, that expands to the
code unit 0xAB, and use that instead of putting raw malformed code units
in test files.

Instead of printing the raw input bytes in snippets in diagnostics,
replace non-printable characters with <AB> in the output, being careful
to still compute the location of the caret and underscore properly.
2025-08-20 21:07:58 +00:00

17 lines
860 B
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
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //testing/file_test:file_test_base_test --test_arg=--file_tests=testing/file_test/testdata/replace_content.carbon
// TIP: To dump output, run:
// TIP: bazel run //testing/file_test:file_test_base_test -- --dump_output --file_tests=testing/file_test/testdata/replace_content.carbon
// CHECK:STDOUT: 2 args: `default_args`, `replace_content.carbon`
library "[[@TEST_NAME]]";
// CHECK:STDOUT: replace_content.carbon:[[@LINE-1]]: library "replace_content";
var x: str = "[[@0x48]][[@0x65]][[@0x6C]][[@0x6C]][[@0x6F]]";
// CHECK:STDOUT: replace_content.carbon:[[@LINE-1]]: var x: str = "Hello";