-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Fix require caching by using correct tuple ordering in resolve_paths (#…
…171)
1 parent
94ba331
commit a65ef2a
Showing
5 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- the idea of this test is that state_module stores some state in one of its local | ||
-- variable | ||
local state_module = require("./state_module") | ||
|
||
-- we confirm that without anything happening, the initial value is what we expect | ||
assert(state_module.state == 10) | ||
|
||
-- this second file also requires state_module and calls a function that changes the local | ||
-- state to 11 | ||
require("./state_second") | ||
|
||
-- with correct module caching, we should see the change done in state_secone reflected | ||
-- here | ||
assert(state_module.state == 11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local M = {} | ||
|
||
M.state = 10 | ||
|
||
function M.set_state(n: number) | ||
M.state = n | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
local state_module = require("./state_module") | ||
|
||
state_module.set_state(11) | ||
|
||
return {} |