diff --git a/gitnexus/test/fixtures/rename-integration/r/source-bom/after/a.R b/gitnexus/test/fixtures/rename-integration/r/source-bom/after/a.R new file mode 100644 index 0000000000..ec3a5aa033 --- /dev/null +++ b/gitnexus/test/fixtures/rename-integration/r/source-bom/after/a.R @@ -0,0 +1,3 @@ +secret <- function(x) x * 2 + +run <- function() secret(2) diff --git a/gitnexus/test/fixtures/rename-integration/r/source-bom/before/a.R b/gitnexus/test/fixtures/rename-integration/r/source-bom/before/a.R new file mode 100644 index 0000000000..7052fe32db --- /dev/null +++ b/gitnexus/test/fixtures/rename-integration/r/source-bom/before/a.R @@ -0,0 +1,3 @@ +helper <- function(x) x * 2 + +run <- function() helper(2) diff --git a/gitnexus/test/fixtures/rename-integration/r/source-bom/case.json b/gitnexus/test/fixtures/rename-integration/r/source-bom/case.json new file mode 100644 index 0000000000..72d855e10b --- /dev/null +++ b/gitnexus/test/fixtures/rename-integration/r/source-bom/case.json @@ -0,0 +1,15 @@ +{ + "language": "r", + "description": "A UTF-8 byte order mark at the start of an R file does not break indexing or rename: the definition on the first line is found and renamed with its call, and the mark is kept.", + "categories": ["encoding", "positive"], + "target": { "name": "helper", "kind": "Function", "file": "a.R", "startLine": 0 }, + "newName": "secret", + "expect": { "status": "success", "edits": 2 }, + "edges": [ + { + "type": "CALLS", + "from": { "name": "run", "kind": "Function", "file": "a.R", "startLine": 2 }, + "to": { "name": "helper", "kind": "Function", "file": "a.R", "startLine": 0 } + } + ] +} diff --git a/gitnexus/test/integration/rename-provider-r.test.ts b/gitnexus/test/integration/rename-provider-r.test.ts index 570f45b525..76c0dd468f 100644 --- a/gitnexus/test/integration/rename-provider-r.test.ts +++ b/gitnexus/test/integration/rename-provider-r.test.ts @@ -5,7 +5,7 @@ import { defineRenameFixtureTests, renameCases } from '../helpers/rename-integra // would define no test and stay green. Pin the number of R cases: adding one means raising it. describe('R rename fixtures', () => { it('are all discovered', () => { - expect(renameCases.filter((fixture) => fixture.language === 'r')).toHaveLength(58); + expect(renameCases.filter((fixture) => fixture.language === 'r')).toHaveLength(59); }); });