Skip to content

Compiler tests diff runner #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 147 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
0635c55
WIP: add compiler runner
gabritto Nov 15, 2024
5094176
add test config functions
gabritto Nov 18, 2024
a08b658
Merge branch 'main' into gabritto/runner
gabritto Nov 18, 2024
292a7c5
add compiler test creation
gabritto Nov 18, 2024
daca070
add more things
gabritto Nov 22, 2024
d4b05d6
Merge branch 'main' into gabritto/runner
gabritto Nov 22, 2024
6c59b48
merge vfs
gabritto Nov 22, 2024
cce7a22
initial test for test runner
gabritto Nov 22, 2024
120b02e
Merge branch 'main' into gabritto/runner
gabritto Nov 23, 2024
01246be
add rootless files to MapFS
gabritto Nov 25, 2024
7f3515a
minor fixes
gabritto Nov 25, 2024
bf6eb2a
add temporary copy of lib to test data
gabritto Nov 25, 2024
e5b77a1
more path fixes; test with multiple files
gabritto Nov 26, 2024
32c1802
update comments
gabritto Nov 27, 2024
c6db098
Merge branch 'main' into gabritto/runner
gabritto Nov 27, 2024
c26c629
change test name so we can use -run, and add descriptions
gabritto Nov 27, 2024
f25e6fa
refactor
gabritto Nov 28, 2024
fd7cd05
remove local baselines before running test
gabritto Nov 29, 2024
5b74f1b
organize functions
gabritto Nov 29, 2024
fdb762d
make one subtest for each type of compiler
gabritto Nov 29, 2024
7f98f96
add conformance test
gabritto Nov 29, 2024
c7ba10e
add symbol baseline generation
gabritto Dec 14, 2024
a31164b
fix compiler errors
gabritto Dec 17, 2024
ef47b9a
Merge branch 'main' into gabritto/runner
gabritto Dec 17, 2024
d68d781
Merge branch 'gabritto/symbolbaseline' into gabritto/runner
gabritto Dec 17, 2024
04ff9cc
add symbol baselines
gabritto Dec 18, 2024
68de1dc
remove unnecessary code
gabritto Dec 18, 2024
e892a68
pass down options instead of pointer
gabritto Dec 18, 2024
619db63
use testing.T in baselines
gabritto Jan 3, 2025
7bd349e
run type and symbol baselines as subtests
gabritto Jan 3, 2025
9b18529
Merge branch 'main' into gabritto/symbolbaseline
gabritto Jan 3, 2025
4f61e6d
fix fmt and merge bug
gabritto Jan 3, 2025
6b4ef82
Merge branch 'gabritto/symbolbaseline' into gabritto/runner
gabritto Jan 3, 2025
7809902
move harness utils into own package to avoid cycle
gabritto Jan 3, 2025
a1b87f1
use bundled lib, update baselines
gabritto Jan 3, 2025
4aaed88
fix regex and helper for symbol baselines
gabritto Jan 3, 2025
de51332
remove useless checkDuplicateName
gabritto Jan 6, 2025
eaaa9d5
Merge branch 'gabritto/symbolbaseline' into gabritto/runner
gabritto Jan 6, 2025
1c25899
remove lib copying for testing, disable type baselines stub
gabritto Jan 6, 2025
53d0c5e
pass subfolder for baselines, update existing baselines
gabritto Jan 6, 2025
09bd8af
Merge branch 'main' into gabritto/runner
gabritto Jan 6, 2025
1842745
add CI step to print baselines
gabritto Jan 6, 2025
2066cd3
fix header of symbol baselines to be relative path
gabritto Jan 6, 2025
4deff4e
skip compiler baselines if noembed
gabritto Jan 6, 2025
8311a72
WIP: diff runner
gabritto Jan 20, 2025
96192e4
Merge branch 'main' into gabritto/diffrunner
gabritto Jan 20, 2025
23c7936
update baselines to reflect new filename header
gabritto Jan 20, 2025
b2178b6
fix merge whitespace
gabritto Jan 20, 2025
bb1e72a
fix merge's symbolToString
gabritto Jan 20, 2025
e4579ac
fix comment in merge
gabritto Jan 20, 2025
2ceec81
re-use submoduleReferencePath
gabritto Jan 20, 2025
d7f55a2
WIP: parse tsconfig and compiler options in tests
gabritto Jan 25, 2025
6225018
Add tsconfig and @options parsing to compiler test runner
gabritto Jan 28, 2025
21f60e8
cleanup: remove extraneous file options map
gabritto Jan 29, 2025
c63d51e
refactor
gabritto Jan 29, 2025
feed17c
use ordered map for initial parsed settings from tests
gabritto Jan 29, 2025
f8ff123
Merge branch 'main' into gabritto/testoptions
gabritto Jan 29, 2025
660ef86
fix build after merge
gabritto Jan 29, 2025
f93e5b7
cleanup
gabritto Jan 29, 2025
42ff6cd
Revert "use ordered map for initial parsed settings from tests"
gabritto Jan 29, 2025
3eec8c7
cleanup + bug fix
gabritto Jan 29, 2025
03f0b05
fix bad merge thing
gabritto Jan 29, 2025
eb758b3
accept baselines
gabritto Jan 29, 2025
c952c96
WIP: working towards a test crash list
gabritto Jan 29, 2025
887a9c3
Merge branch 'main' into gabritto/diffrunner
gabritto Jan 29, 2025
cd551de
add default case for harness option parsing
gabritto Jan 30, 2025
f33b3af
Merge branch 'main' into gabritto/testoptions
gabritto Jan 30, 2025
ec07476
move vfsparseconfighost to a test package
gabritto Jan 30, 2025
91a783b
Merge branch 'main' into gabritto/diffrunner
gabritto Jan 30, 2025
fdaa49a
Merge branch 'gabritto/testoptions' into gabritto/diffrunner
gabritto Jan 31, 2025
0324bf9
Merge branch 'main' into gabritto/diffrunner
gabritto Jan 31, 2025
13e2745
skip jsx tests
gabritto Feb 3, 2025
8af6766
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 4, 2025
9c07594
Some fixes
gabritto Feb 5, 2025
c32ef2d
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 5, 2025
4c8de5f
update baseline
gabritto Feb 5, 2025
8bb2f29
module resolution fix
gabritto Feb 5, 2025
8b3aa1f
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 6, 2025
da3e22b
skip some stack overflow tests
gabritto Feb 7, 2025
ecc097b
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 7, 2025
6a8fc9e
update list of skipped tests
gabritto Feb 7, 2025
f4d4967
remove recover()
gabritto Feb 12, 2025
487e591
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 12, 2025
75dcc76
disable types baselines in diff for now
gabritto Feb 12, 2025
7ce1857
WIP: skip more tests
gabritto Feb 13, 2025
621c5eb
fix memory issue; skip deprecated tests
gabritto Feb 13, 2025
ab4609a
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 13, 2025
6015e67
Add example of current diff baselines
gabritto Feb 13, 2025
83213f2
fix lint
gabritto Feb 13, 2025
d2cb724
add test basename to diff
gabritto Feb 13, 2025
cc86c43
fix go.mod
gabritto Feb 13, 2025
a7a8d98
remove old bug fix
gabritto Feb 13, 2025
39baf1d
add prefix to file in diff
gabritto Feb 14, 2025
18d0221
switch order of corsa vs strada in diff
gabritto Feb 14, 2025
8c88222
add race detection and make compiler multi-threaded in tests under ra…
gabritto Feb 14, 2025
4f2123c
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 14, 2025
4a4763e
move race package
gabritto Feb 14, 2025
3a7f232
fix bug in file extension of symbol baselines
gabritto Feb 14, 2025
aa99801
fix libFiles parsing
gabritto Feb 14, 2025
b3cf829
capture stack in recover and make it a helper
gabritto Feb 14, 2025
984df42
fix dumb defer
gabritto Feb 14, 2025
a39ca86
fix lint
gabritto Feb 14, 2025
c18b1be
format
gabritto Feb 14, 2025
3c0deae
update comments
gabritto Feb 14, 2025
5c9b756
rename tests
gabritto Feb 14, 2025
f3d3462
rename diff to submodule
gabritto Feb 14, 2025
1c5dd2b
fix test file name
gabritto Feb 14, 2025
b0e20ac
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 14, 2025
665cbf7
fix order of insertion of compiler options when varying
gabritto Feb 14, 2025
9f7e57b
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 14, 2025
55572aa
Merge branch 'gabritto/diffrunner' of https://github.com/microsoft/ty…
gabritto Feb 14, 2025
39cc4b2
don't deduplicate deprecated module resolution options that now map t…
gabritto Feb 14, 2025
c5d22f3
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 14, 2025
cb883a9
add baseline references
gabritto Feb 14, 2025
765d816
Merge branch 'gabritto/diffrunner' of https://github.com/microsoft/ty…
gabritto Feb 14, 2025
6f66fae
skip if no submodule
gabritto Feb 14, 2025
7f4ad41
dont write to local if not needed
gabritto Feb 15, 2025
9689be0
increase timeout in CI
gabritto Feb 15, 2025
595ce19
upload artifact with local baselines
gabritto Feb 15, 2025
066cb1b
normalize file name to lowercase
gabritto Feb 15, 2025
7c4d944
accept baselines
gabritto Feb 15, 2025
5a5be01
rename ci artifact
gabritto Feb 15, 2025
0ad7ce8
hopefully fix case of reference baselines
gabritto Feb 15, 2025
09a3c16
Merge branch 'main' into gabritto/diffrunner
jakebailey Feb 18, 2025
9002d27
Add test mode explicitly for testing concurrent programs in test harness
jakebailey Feb 18, 2025
f236a6a
Use correct checker for files in type/symbol baselines
jakebailey Feb 18, 2025
93dc59a
fix paren
jakebailey Feb 18, 2025
952c5b8
Fix typo
jakebailey Feb 18, 2025
adfaf37
Merge branch 'main' into gabritto/diffrunner
jakebailey Feb 19, 2025
6296c72
Merge branch 'main' into gabritto/diffrunner
jakebailey Feb 20, 2025
5edaf1a
Try out new pool
jakebailey Feb 20, 2025
0f2cad7
Fix setup-node I guess
jakebailey Feb 20, 2025
e4880bf
Merge branch 'main' into gabritto/diffrunner
jakebailey Feb 24, 2025
e448a8c
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 25, 2025
266bef6
Merge branch 'main' into gabritto/diffrunner
jakebailey Feb 25, 2025
8ea264c
Fix
jakebailey Feb 25, 2025
a82c26f
Merge branch 'main' into gabritto/diffrunner
gabritto Feb 26, 2025
90d8233
skip test that relies on noTruncation truncation limit
gabritto Feb 26, 2025
838572b
update baselines to reflect correct loading of @lib
gabritto Feb 26, 2025
232652b
skip test that is different in multi-threaded mode
gabritto Feb 26, 2025
74bb573
remove unused baselines
gabritto Feb 26, 2025
0c51bd2
copy over unused baselines check
gabritto Feb 26, 2025
253a967
debug: don't silence test output
gabritto Feb 26, 2025
c4a1b11
drop unused baselines checking
gabritto Feb 26, 2025
d695f6b
delete unused compiler baselines
gabritto Feb 26, 2025
54ff224
Remove line numbers from unified diff headers
jakebailey Feb 26, 2025
61147cf
1 index
jakebailey Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,19 @@ jobs:
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest
name: 'no submodules'
no-submodules: true
- os: ubuntu-latest
- os: ['self-hosted', '1ES.Pool=TypeScript-1ES-GitHub-XL', '1ES.ImageOverride=mariner-2.0']
name: 'race mode'
race: true
- os: ubuntu-latest
name: 'noembed'
noembed: true
- os: ubuntu-latest
name: 'concurrent test programs'
concurrent-test-program: true

name: test (${{ matrix.os }}${{ (matrix.no-submodules && ' without submodules') || '' }}${{ (matrix.race && ' in race mode') || '' }}${{ (matrix.noembed && ' with noembed') || '' }})
name: test (${{ matrix.name || matrix.os }})

runs-on: ${{ matrix.os }}

Expand All @@ -58,6 +64,8 @@ jobs:
with:
submodules: ${{ !matrix.no-submodules }}
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
with:
cache-name: test
Expand All @@ -71,10 +79,11 @@ jobs:

- name: Tests
id: test
run: npx hereby test:all ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"}
run: npx hereby test:all ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"} ${CONCURRENTTESTPROGRAM_FLAG:+"$CONCURRENTTESTPROGRAM_FLAG"}
env:
RACE_FLAG: ${{ (matrix.race && '--race') || '' }}
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}
CONCURRENTTESTPROGRAM_FLAG: ${{ (matrix.concurrent-test-program && '--concurrentTestPrograms') || '' }}

- run: git add .
- run: git diff --staged --exit-code --stat
Expand All @@ -85,6 +94,11 @@ jobs:
npx hereby baseline-accept
git add testdata/baselines/reference
git diff --staged --exit-code
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: ${{ failure() && steps.test.conclusion == 'failure' }}
with:
name: ${{ matrix.os }}-${{ (matrix.race && 'race') || 'norace' }}-new-baselines-artifact
path: testdata/baselines/local

lint:
runs-on: ubuntu-latest
Expand Down
14 changes: 11 additions & 3 deletions Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ const { values: options } = parseArgs({
fix: { type: "boolean" },
noembed: { type: "boolean" },
debug: { type: "boolean" },
concurrentTestPrograms: { type: "boolean" },
},
strict: false,
allowPositionals: true,
allowNegative: true,
noembed: false,
debug: false,
concurrentTestPrograms: false,
});

const defaultGoBuildTags = [
Expand Down Expand Up @@ -203,6 +205,12 @@ const goTestFlags = [
...goBuildTags(),
];

const goTestEnv = {
...(options.concurrentTestPrograms ? { TS_TEST_PROGRAM_SINGLE_THREADED: "false" } : {}),
};

const $test = $({ env: goTestEnv });

const gotestsum = memoize(() => {
const args = isInstalled("gotestsum") ? ["gotestsum", "--format-hide-empty-pkg", "--"] : ["go", "test"];
return args.concat(goTestFlags);
Expand All @@ -213,7 +221,7 @@ const goTest = memoize(() => {
});

async function runTests() {
await $`${gotestsum()} ./...`;
await $test`${gotestsum()} ./... ${isCI ? ["--timeout=45m"] : []}`;
}

export const test = task({
Expand All @@ -223,7 +231,7 @@ export const test = task({

async function runTestBenchmarks() {
// Run the benchmarks once to ensure they compile and run without errors.
await $`${goTest()} -run=- -bench=. -benchtime=1x ./...`;
await $test`${goTest()} -run=- -bench=. -benchtime=1x ./...`;
}

export const testBenchmarks = task({
Expand All @@ -232,7 +240,7 @@ export const testBenchmarks = task({
});

async function runTestTools() {
await $({ cwd: path.join(__dirname, "_tools") })`${gotestsum()} ./...`;
await $test({ cwd: path.join(__dirname, "_tools") })`${gotestsum()} ./...`;
}

export const testTools = task({
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/dlclark/regexp2 v1.11.4
github.com/go-json-experiment/json v0.0.0-20241127185351-9802db03f36a
github.com/google/go-cmp v0.6.0
github.com/pkg/diff v0.0.0-20241224192749-4e6772a4315c
golang.org/x/sys v0.27.0
golang.org/x/tools v0.27.0
gotest.tools/v3 v3.5.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ github.com/go-json-experiment/json v0.0.0-20241127185351-9802db03f36a h1:W/o3DbE
github.com/go-json-experiment/json v0.0.0-20241127185351-9802db03f36a/go.mod h1:BWmvoE1Xia34f3l/ibJweyhrT+aROb/FQ6d+37F0e2s=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pkg/diff v0.0.0-20241224192749-4e6772a4315c h1:8TRxBMS/YsupXoOiGKHr9ZOXo+5DezGWPgBAhBHEHto=
github.com/pkg/diff v0.0.0-20241224192749-4e6772a4315c/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/emitHost.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ func (host *emitHost) WriteFile(fileName string, text string, writeByteOrderMark
}

func (host *emitHost) GetEmitResolver(file *ast.SourceFile, skipDiagnostics bool) checker.EmitResolver {
checker := host.program.getTypeCheckerForFile(file)
checker := host.program.GetTypeCheckerForFile(file)
return checker.GetEmitResolver(file, skipDiagnostics)
}
6 changes: 3 additions & 3 deletions internal/compiler/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (p *Program) BindSourceFiles() {

func (p *Program) CheckSourceFiles() {
p.createCheckers()
wg := core.NewWorkGroup(false)
wg := core.NewWorkGroup(p.programOptions.SingleThreaded)
for index, checker := range p.checkers {
wg.Queue(func() {
for i := index; i < len(p.files); i += len(p.checkers) {
Expand Down Expand Up @@ -227,7 +227,7 @@ func (p *Program) GetTypeChecker() *checker.Checker {
// method returns the checker that was tasked with checking the file. Note that it isn't possible to mix
// types obtained from different checkers, so only non-type data (such as diagnostics or string
// representations of types) should be obtained from checkers returned by this method.
func (p *Program) getTypeCheckerForFile(file *ast.SourceFile) *checker.Checker {
func (p *Program) GetTypeCheckerForFile(file *ast.SourceFile) *checker.Checker {
p.createCheckers()
return p.checkersByFile[file]
}
Expand Down Expand Up @@ -299,7 +299,7 @@ func (p *Program) getBindDiagnosticsForFile(sourceFile *ast.SourceFile) []*ast.D
}

func (p *Program) getSemanticDiagnosticsForFile(sourceFile *ast.SourceFile) []*ast.Diagnostic {
diags := core.Concatenate(sourceFile.BindDiagnostics(), p.getTypeCheckerForFile(sourceFile).GetDiagnostics(sourceFile))
diags := core.Concatenate(sourceFile.BindDiagnostics(), p.GetTypeCheckerForFile(sourceFile).GetDiagnostics(sourceFile))
if len(sourceFile.CommentDirectives) == 0 {
return diags
}
Expand Down
75 changes: 72 additions & 3 deletions internal/testutil/baseline/baseline.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,90 @@ import (
"fmt"
"os"
"path/filepath"
"regexp"
"strings"
"testing"

"github.com/microsoft/typescript-go/internal/repo"
"github.com/pkg/diff"
)

type Options struct {
Subfolder string
Subfolder string
IsSubmodule bool
}

const NoContent = "<no content>"
const (
NoContent = "<no content>"
submoduleFolder = "submodule"
)

func Run(t *testing.T, fileName string, actual string, opts Options) {
writeComparison(t, actual, fileName, false /*useSubmodule*/, opts)
if opts.IsSubmodule {
diff := getBaselineDiff(t, actual, fileName)
diffFileName := fileName + ".diff"
opts.Subfolder = filepath.Join(submoduleFolder, opts.Subfolder)
referenceFileName := referencePath(fileName, opts.Subfolder)
expected := NoContent
if content, err := os.ReadFile(referenceFileName); err == nil {
expected = string(content)
}
// Write original baseline in addition to diff baseline, if needed, but don't fail if they don't match
if actual != expected {
localFileName := localPath(fileName, opts.Subfolder)
if err := os.MkdirAll(filepath.Dir(localFileName), 0o755); err != nil {
t.Fatal(fmt.Errorf("failed to create directories for the local baseline file %s: %w", localFileName, err))
}
if err := os.WriteFile(localFileName, []byte(actual), 0o644); err != nil {
t.Fatal(fmt.Errorf("failed to write the local baseline file %s: %w", localFileName, err))
}
}
writeComparison(t, diff, diffFileName, false /*useSubmodule*/, opts)
} else {
writeComparison(t, actual, fileName, false /*useSubmodule*/, opts)
}
}

func getBaselineDiff(t *testing.T, actual string, fileName string) string {
expected := NoContent
refFileName := submoduleReferencePath(fileName, "" /*subfolder*/)
if content, err := os.ReadFile(refFileName); err == nil {
expected = string(content)
}
if actual == expected {
return NoContent
}
var b strings.Builder
if err := diff.Text("old."+fileName, "new."+fileName, expected, actual, &b); err != nil {
t.Fatalf("failed to diff the actual and expected content: %v", err)
}

// Remove line numbers from unified diff headers; this avoids adding/deleting
// lines in our baselines from causing knock-on header changes later in the diff.
s := b.String()

aCurLine := 1
bCurLine := 1
s = fixUnifiedDiff.ReplaceAllStringFunc(s, func(match string) string {
var aLine, aLineCount, bLine, bLineCount int
if _, err := fmt.Sscanf(match, "@@ -%d,%d +%d,%d @@", &aLine, &aLineCount, &bLine, &bLineCount); err != nil {
panic(fmt.Sprintf("failed to parse unified diff header: %v", err))
}
aDiff := aLine - aCurLine
bDiff := bLine - bCurLine
aCurLine = aLine
bCurLine = bLine

// Keep surrounded by @@, to make GitHub's grammar happy.
// https://github.com/textmate/diff.tmbundle/blob/0593bb775eab1824af97ef2172fd38822abd97d7/Syntaxes/Diff.plist#L68
return fmt.Sprintf("@@= skipped -%d, +%d lines =@@", aDiff, bDiff)
})

return s
}

var fixUnifiedDiff = regexp.MustCompile(`@@ -\d+,\d+ \+\d+,\d+ @@`)

func RunAgainstSubmodule(t *testing.T, fileName string, actual string, opts Options) {
writeComparison(t, actual, fileName, true /*useSubmodule*/, opts)
}
Expand Down
Loading