refactor: drop the now dead compterEvenements helper
It existed as T1's proof of life; the rendered list proves it better. liste.js was its only caller and no longer counts VEVENTs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
3d86330894
commit
532c17747f
@@ -30,9 +30,3 @@ export async function recupererFluxCalendrier(fetchImpl) {
|
||||
}
|
||||
return { ok: true, flux };
|
||||
}
|
||||
|
||||
// Preuve de vie de T1 : compte les vrais débuts de VEVENT (ancrage ligne, pas
|
||||
// une chaîne « BEGIN:VEVENT » apparaissant dans une DESCRIPTION).
|
||||
export function compterEvenements(flux) {
|
||||
return (flux.match(/^BEGIN:VEVENT\s*$/gm) ?? []).length;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import {
|
||||
URL_CALENDRIER,
|
||||
compterEvenements,
|
||||
recupererFluxCalendrier,
|
||||
} from "./extension/nextcloud.js";
|
||||
|
||||
@@ -65,21 +64,3 @@ describe("recupererFluxCalendrier", () => {
|
||||
expect(optionsVues).toEqual({ credentials: "include" });
|
||||
});
|
||||
});
|
||||
|
||||
describe("compterEvenements", () => {
|
||||
test("compte 2 VEVENT", () => {
|
||||
const flux =
|
||||
"BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
|
||||
expect(compterEvenements(flux)).toBe(2);
|
||||
});
|
||||
|
||||
test("compte 0 quand aucun VEVENT", () => {
|
||||
expect(compterEvenements("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n")).toBe(0);
|
||||
});
|
||||
|
||||
test("ignore un BEGIN:VEVENT au milieu d'une DESCRIPTION", () => {
|
||||
const flux =
|
||||
"BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDESCRIPTION:texte BEGIN:VEVENT piège\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
|
||||
expect(compterEvenements(flux)).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user