FlexLove GUI Library Test Suite
This directory contains comprehensive tests for the FlexLove GUI library. The tests cover layout behavior, property management, animations, and utility functions.
Test Files
-
01_absolute_positioning.lua
- Basic absolute positioning
- Parent-child relationships
- Coordinate system tests
-
02_flex_direction.lua
- Horizontal flex layout
- Vertical flex layout
- Mixed direction layouts
-
03_vertical_flex_direction.lua
- Vertical layout specifics
- Column-based layouts
- Vertical alignment
-
04_justify_content.lua
- Flex-start alignment
- Flex-end alignment
- Space-between distribution
- Space-around distribution
-
05_align_items.lua
- Cross-axis alignment
- Stretch behavior
- Baseline alignment
-
06_flex_wrap.lua
- Wrapping behavior
- Multi-line layouts
- Wrap alignment
-
07_layout_validation.lua
- Edge cases
- Nested containers
- Deep hierarchies
-
08_performance.lua
- Large element counts
- Deep hierarchies
- Dynamic updates
- Rapid resizing
-
09_element_properties.lua
- Basic properties
- Custom properties
- Property modification
- Visibility and clipping
-
10_animation_and_transform.lua
- Basic transformations
- Animation tweening
- Easing functions
- Animation cancellation
-
11_auxiliary_functions.lua
- Element queries
- Debug utilities
- Layout helpers
- Utility functions
Running Tests
Run All Tests
cd /path/to/station_alpha
for f in game/libs/testing/__tests__/flexlove/*.lua; do lua "$f"; done
Run Specific Test File
cd /path/to/station_alpha
lua game/libs/testing/__tests__/flexlove/[test_file].lua
Test Structure
Each test file follows this general structure:
package.path = package.path .. ";/path/to/station_alpha/?.lua"
local luaunit = require('game/libs/testing/luaunit')
require('game/libs/testing/loveStub')
local FlexLove = require('game/libs/FlexLove')
TestClassName = {}
function TestClassName:setUp()
self.GUI = FlexLove.GUI
end
function TestClassName:testFeature()
-- Test implementation
end
os.exit(luaunit.LuaUnit.run())
Known Issues
-
Layout Calculations
- Some justify-content calculations need verification
- Align-items behavior needs adjustment
- Flex-wrap positioning requires fixes
-
Missing Methods
- Animation and transform methods not implemented
- Some utility functions not available
- Custom property support incomplete
-
Performance
- Resize calculations may need optimization
- Deep hierarchy performance could be improved
Contributing
When adding new tests:
- Follow the existing naming convention
- Add proper type annotations
- Include nil checks for optional features
- Document expected behavior
- Add the test to this README
Dependencies
- Lua 5.1+ / LuaJIT
- LÖVE2D (for graphics features)
- luaunit (testing framework)