Skip to content

Light Up Test Suite Docs

andrewtarnavsky edited this page Oct 18, 2024 · 13 revisions

Direct Rule Tests

Empty Cells in Light - LTUP-BASC-0001

Test Case 1 - Empty Cell in Light Direct Rule:

EmptyCells
  • Checks that the rule correctly detects empty cells in light (yellow tiles), and doesn't erroneously detect black cells, lightbulbs, or unlit empty cells as empty cells in light.

Empty Corners - LTUP-BASC-0002

Test Case 1 - Empty Corners Test:

EmptyCorners
  • Checks that adding empty cell marks to (2,2), (0,2), and (4,3) does correctly satisfy the empty corners rule.
  • Checks that adding an empty cell mark to (4,5) does not get accepted as satisfying the rule, as it is skipping steps.
  • Checks that adding an empty cell mark to (4,1) does not falsely trigger the empty corners rule.

Finish with Bulbs - LTUP-BASC-0003

Test Case 1 - Finish Bulb Test:

FinishWithBulbs
  • Verifies that the rule is logically followed by checking that the rule is satisfied at the specific cell (1,0), while confirming that the rule fails at all other cells, except for the one logically connected to the rule.

Test Case 2 - Finish Bulb Test with Three:

FinishWithBulbsWithThree
  • Verifies that the rule logically holds when three bulbs are placed at specific cells (1,2), (0,1), and (2,1), while ensuring that other cells do not satisfy the rule.

Finish with Empty - LTUP-BASC-0004

Test Case 1 - Finish Empty Test with One:

FinishEmptyWithOne
  • Verifies that the rule logically holds when three cells adjacent to a "1" clue (located at (1,1)) are set to empty, ensuring other cells do not satisfy the rule.

Test Case 2 - Finish Empty Test with Three:

FinishEmptyWithThree
  • Verifies that the rule logically holds when one cell above a "3" clue (located at (1,1)) is set to empty, ensuring other cells follow the rule and other unrelated cells do not.

Must Light - LTUP-BASC-0005

Test Case 1 - Must Light Test:

MustLight
  • Ensures that the rule logically holds when a bulb is placed at (1,2), and verifies that no other cell in the image follows the rule.

Contradiction Rule Tests

Bulbs In Path - LTUP-CONT-0001

Test Case 1 - Light in Horizontal Path:

LightInHorizontalPath
  • Checks that the rule correctly detects overlapping light paths, when lights are placed on the same horizontal level without any blocks between them

Test Case 2 - Light in Vertical Path:

LightInVerticalPath
  • Checks that the rule correctly detects overlapping light paths, when lights are placed on the same vertical level without any blocks between them

Test Case 3 - Block in Horizontal Path:

BlockInHorizontalPath
  • Checks that the rule doesn't erroneously detect overlapping light paths, when lights are placed on the same horizontal level with a block placed between them

Test Case 4 - Vertical Black Between Regions:

BlockInVerticalPath
  • Checks that the rule doesn't erroneously detect overlapping light paths, when lights are placed on the same vertical level with a block placed between them

Cannot Light A Cell - LTUP-CONT-0002

Test Case 1 - Full Light Test:

FullLightTest
  • Checks that the rule correctly detects that (1,3) and (3,3) are unable to be lit
  • Checks that the rule doesn't erroneously detect (0,0), (1,1), (1,0), and (3,2) as unable to be lit

Test Case 2 - Cannot Light Test:

CannotLightTest
  • Checks that the rule correctly detects that (1,1) is unable to be lit

Test Case 3 - Can Light Test:

CanLightTest
  • Checks that the rule doesn't erroneously detect a contradiction on the board

Too Few Bulbs - LTUP-CONT-0003

Test Case 1 - Full Too Few Test:

FullTooFewTest
  • Checks that the rule correctly detects that (1,1), (4,1), and (1,4) do not have sufficient bulbs surrounding the black tiles

Test Case 2 - Too Few Simple Test:

TooFew
  • Checks that the rule correctly detects that the center square (1,1) is impossible to satisfy

Too Many Bulbs - LTUP-CONT-0004

Test Case 1 - Full Too Many Test:

FullTooManyTest
  • Checks that the rule correctly detects that (1,1) and (1,4) have too many bulbs surrounding the black tiles

Test Case 2 - Too Many Simple Test:

TooMany
  • Checks that the rule correctly detects that (1,1) has too many bulbs surrounding the black tiles

Case Rule Tests

Light or Empty - LTUP-CASE-0001

Test Case 1 - Light Or Empty Test:

LightOrEmpty
  • Verifies that the getCases function of the LightOrEmptyCaseRule class correctly generates the expected number of possible board configurations (two cases in this example).

Satisfy Number - LTUP-CASE-0002

Test Case 1 - Satisfy Number Test:

SatisfyNumber
  • Verifies that the case rule correctly generates all valid board configurations for a specific numbered cell in the Light Up puzzle, ensuring that the expected number of cases (2) is produced.

Test Case 2 - Satisfy Number Test Two:

SatisfyNumberTwo
  • Verifies that the case rule generates the correct number of valid board configurations (6) for the specific numbered cell above.
Clone this wiki locally