Skip to content

Consider converting tests/ui/json/json-bom-plus-crlf-multifile-aux.rs-associated tests into a run-make tests #139968

Open
@jieyouxu

Description

@jieyouxu

I found this aux file (and its associated main test file) really awkward to change, because the in-source BOM marker and CRLF line endings are load-bearing. Apparently the byte offsets are, too. Probably use a run-make test instead to "craft" a BOM + CRLF auxiliary instead to:

  1. Make it possible to adjust the auxiliary without accidentally regressing the test intention.
  2. Have some checks that the auxiliary actually has the BOM marker + CRLF line endings.

That test directory uses .gitattributes to help enforce CRLF line endings, which is clever, but also...

// (This line has BOM so it's ignored by compiletest for directives)
//
//@ ignore-test Not a test. Used by other tests
// ignore-tidy-cr
// For easier verifying, the byte offsets in this file should match those
// in the json-bom-plus-crlf.rs - given the actual fn is identical (just with
// a different, but equally sized name), the easiest way to do this is to
// ensure the two files are of equal size on disk.
// Padding............................
// N.B., this file needs CRLF line endings. The .gitattributes file in
// this directory should enforce it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions