12)
13
14▶func findLanguagesRow(t *testing.T, rows []languagesTimelineRow, language string) languagesTimelineRow {
15 t.Helper()
16 for _, r := range rows {
· · ·
26// TypeScript code is added over time while JavaScript code is steadily
27// removed, the trajectory and change sign should reflect that.
28▶func TestLanguagesTimelineTSRisesJSFalls(t *testing.T) {
29 // Set HistoryDepth so the JS-baseline commit (commit 0) sits OUTSIDE
30 // the window — the engine then seeds JavaScript with that file's lines
· · ·
33 saveDepth, saveBuckets := HistoryDepth, HistoryBuckets
34 HistoryDepth, HistoryBuckets = 9, 10
35▶ t.Cleanup(func() {
36 HistoryDepth, HistoryBuckets = saveDepth, saveBuckets
37 })
· · ·
105// of the window and is then wholly removed should show codeNow == 0 and a
106// negative change.
107▶func TestLanguagesTimelineLanguageRemoval(t *testing.T) {
108 // depth=2 → only the last 2 commits are in the window. The first
109 // commit (which establishes the JS file) sits OUTSIDE the window and
· · ·
112 saveDepth, saveBuckets := HistoryDepth, HistoryBuckets
113 HistoryDepth, HistoryBuckets = 2, 6
114▶ t.Cleanup(func() {
115 HistoryDepth, HistoryBuckets = saveDepth, saveBuckets
116 })
+ 26 more matches in this file