mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2026-09-28 19:02:24 +07:00
added the new evolved.depth function
This commit is contained in:
+1
-2
@@ -9,8 +9,7 @@
|
||||
|
||||
## Thoughts
|
||||
|
||||
- We can return deferred status from modifying operations and spawn/clone methods.
|
||||
- We should have a way to not copy components on deferred spawn/clone.
|
||||
- We should have a way to not copy components on deferred spawn/clone
|
||||
|
||||
## Known Issues
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
require 'develop.testing.build_tests'
|
||||
require 'develop.testing.cancel_tests'
|
||||
require 'develop.testing.clone_tests'
|
||||
require 'develop.testing.depth_tests'
|
||||
require 'develop.testing.destroy_tests'
|
||||
require 'develop.testing.locate_tests'
|
||||
require 'develop.testing.main_tests'
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
local evo = require 'evolved'
|
||||
|
||||
do
|
||||
assert(evo.depth() == 0)
|
||||
|
||||
assert(evo.defer())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(not evo.defer())
|
||||
assert(evo.depth() == 2)
|
||||
|
||||
assert(not evo.cancel())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(evo.cancel())
|
||||
assert(evo.depth() == 0)
|
||||
end
|
||||
|
||||
do
|
||||
assert(evo.depth() == 0)
|
||||
|
||||
assert(evo.defer())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(not evo.defer())
|
||||
assert(evo.depth() == 2)
|
||||
|
||||
assert(not evo.commit())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(evo.commit())
|
||||
assert(evo.depth() == 0)
|
||||
end
|
||||
|
||||
do
|
||||
assert(evo.depth() == 0)
|
||||
|
||||
assert(evo.defer())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(not evo.defer())
|
||||
assert(evo.depth() == 2)
|
||||
|
||||
assert(not evo.cancel())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(evo.commit())
|
||||
assert(evo.depth() == 0)
|
||||
end
|
||||
|
||||
do
|
||||
assert(evo.depth() == 0)
|
||||
|
||||
assert(evo.defer())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(not evo.defer())
|
||||
assert(evo.depth() == 2)
|
||||
|
||||
assert(not evo.commit())
|
||||
assert(evo.depth() == 1)
|
||||
|
||||
assert(evo.cancel())
|
||||
assert(evo.depth() == 0)
|
||||
end
|
||||
Reference in New Issue
Block a user