Skip to content

Read before/after test results from a file for easier formatting / test verification? #2

@ryanseys

Description

@ryanseys

Have you considered putting the expected test results in separate files and reading them in and comparing them to the output? This might be easier than writing concatenation code like this little ditty:

".OtherActivity\">\n" +
"        </activity>\n" +
"\n" +
"        <activity android:name=\"com.example.android.custom-lint-rules" +
".MainActivity\">\n" +
"            <intent-filter>\n" +

which is very easy to screw up, requires a lot of trial and error, and is hard to see being correct at a quick glance.

Something like assertTrue(runLint("test1before.txt").equals(readFile("test1after.txt"))); would making writing and verifying tests much faster and easier to maintain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions