diff --git a/.luacov b/.luacov new file mode 100644 index 0000000..9488f62 --- /dev/null +++ b/.luacov @@ -0,0 +1,5 @@ +modules = { + ['evolved'] = 'evolved.lua' +} +reporter = 'html' +reportfile = 'luacov.report.html' diff --git a/README.md b/README.md index 82c83c2..a9c4aa0 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ luarocks install evolved.lua ## Quick Start -To get started with `evolved.lua`, read the [Overview](#overview) section to understand the basic concepts and how to use the library. After that, check the [Example](develop/example.lua), which demonstrates complex usage of the library. Finally, refer to the [Cheat Sheet](#cheat-sheet) for a quick reference of all the functions and classes provided by the library. +To get started with `evolved.lua`, read the [Overview](#overview) section to understand the basic concepts and how to use the library. After that, check the [Samples](develop/samples), which demonstrate complex usage of the library. Finally, refer to the [Cheat Sheet](#cheat-sheet) for a quick reference of all the functions and classes provided by the library. ## Overview diff --git a/develop/all.lua b/develop/all.lua index c352fe2..b5d6025 100644 --- a/develop/all.lua +++ b/develop/all.lua @@ -1,13 +1,13 @@ -require 'develop.example' -require 'develop.untests' - require 'develop.samples.relations' +require 'develop.samples.systems' require 'develop.testing.name_tests' require 'develop.testing.pairs_tests' require 'develop.testing.requires_fragment_tests' require 'develop.testing.system_as_query_tests' +require 'develop.untests' + require 'develop.unbench' require 'develop.usbench' diff --git a/develop/samples/relations.lua b/develop/samples/relations.lua index 7e98174..6311fbe 100644 --- a/develop/samples/relations.lua +++ b/develop/samples/relations.lua @@ -5,17 +5,32 @@ local evo = require 'evolved' evo.debug_mode(true) local fragments = { - planet = evo.builder():name('planet'):tag():spawn(), - spaceship = evo.builder():name('spaceship'):tag():spawn(), + planet = evo.builder() + :name('planet') + :tag() + :spawn(), + spaceship = evo.builder() + :name('spaceship') + :tag() + :spawn(), } local relations = { - docked_to = evo.builder():name('docked_to'):tag():explicit():spawn(), + docked_to = evo.builder() + :name('docked_to') + :tag() + :spawn(), } local planets = { - mars = evo.builder():name('Mars'):set(fragments.planet):spawn(), - venus = evo.builder():name('Venus'):set(fragments.planet):spawn(), + mars = evo.builder() + :name('Mars') + :set(fragments.planet) + :spawn(), + venus = evo.builder() + :name('Venus') + :set(fragments.planet) + :spawn(), } local spaceships = { diff --git a/develop/example.lua b/develop/samples/systems.lua similarity index 100% rename from develop/example.lua rename to develop/samples/systems.lua diff --git a/develop/testing/pairs_tests.lua b/develop/testing/pairs_tests.lua index 1cfee0d..b9f6407 100644 --- a/develop/testing/pairs_tests.lua +++ b/develop/testing/pairs_tests.lua @@ -1441,3 +1441,6 @@ do assert(evo.has(e, evo.pair(p, s)) and evo.get(e, evo.pair(p, s)) == nil) end end + +-- TODO +-- builder:has/has_all/has_any should work with wildcards / remove too?