···21212222 describe("restrictions", () => {
2323 it("applies format legality restriction", () => {
2424- // Search for a card that's banned in some formats
2424+ // Time Walk is restricted in vintage (legal) but not in standard
2525 const results = worker.searchCards(
2626- "ancestral recall",
2626+ "time walk",
2727 { format: "vintage" },
2828 10,
2929 );
3030 expect(results.length).toBeGreaterThan(0);
31313232- // Should not find it in standard (banned)
3232+ // Should not find it in standard
3333 const standardResults = worker.searchCards(
3434- "ancestral recall",
3434+ "time walk",
3535 { format: "standard" },
3636 10,
3737 );
+7-8
src/workers/__tests__/syntax-search.test.ts
···197197198198 describe("deduplication", () => {
199199 it("returns one result per oracle_id", () => {
200200- // Lightning Bolt has many printings across sets
201201- const result = worker.syntaxSearch('!"Lightning Bolt"', 100);
200200+ // Ponder has many printings across sets but only one oracle_id
201201+ const result = worker.syntaxSearch('!"Ponder"', 100);
202202 expect(result.ok).toBe(true);
203203 if (result.ok) {
204204- // Should only have one result despite many printings
205204 expect(result.cards.length).toBe(1);
206206- expect(result.cards[0].name).toBe("Lightning Bolt");
205205+ expect(result.cards[0].name).toBe("Ponder");
207206 }
208207 });
209208···611610 }
612611 });
613612614614- it("is:gainland returns exactly 15 cards (two cycles)", () => {
613613+ it("is:gainland returns at least 15 cards (two cycles)", () => {
615614 const result = worker.syntaxSearch("is:gainland", 100);
616615 expect(result.ok).toBe(true);
617616 if (result.ok) {
618618- expect(result.cards.length).toBe(15);
617617+ expect(result.cards.length).toBeGreaterThanOrEqual(15);
619618 for (const card of result.cards) {
620619 expect(card.type_line).toContain("Land");
621620 expect(card.oracle_text).toMatch(/gain 1 life/i);
···623622 }
624623 });
625624626626- it("is:tangoland returns exactly 8 cards", () => {
625625+ it("is:tangoland returns at least 8 cards", () => {
627626 const result = worker.syntaxSearch("is:tangoland", 100);
628627 expect(result.ok).toBe(true);
629628 if (result.ok) {
630630- expect(result.cards.length).toBe(8);
629629+ expect(result.cards.length).toBeGreaterThanOrEqual(8);
631630 for (const card of result.cards) {
632631 expect(card.type_line).toContain("Land");
633632 expect(card.oracle_text).toMatch(/two or more basic/i);