Skip to content

Commit 9253f70

Browse files
coverage: fix loaded function name
Now we load flatten functions for spaces with `@flatten` source. Source starting with @ assumes that it describes the file name, yet here it isn't. Then luacov fails to find "flatten" file on coverage info build. When we do not specify source explicitly, the whole string became the source. It will not confuse luacov anymore (it just ignores them), and it's more helpful for debug. 1. https://www.lua.org/manual/5.2/manual.html#pdf-load Closes #249
1 parent b5e2b27 commit 9253f70

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Changed
1111
* Yield on select/pairs storage tuple lookup (#312).
1212

13+
### Fixed
14+
* Loaded functions misleading coverage (#249).
15+
1316
## [1.1.0] - 13-03-23
1417

1518
### Added

crud/common/utils.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function utils.flatten(object, space_format, bucket_id, skip_nullability_check)
217217
fieldmap = fieldmap,
218218
NULL = box.NULL,
219219
}
220-
flatten_func = assert(load(code, '@flatten', 't', env))
220+
flatten_func = assert(load(code, nil, 't', env))
221221

222222
flatten_functions_cache[space_format] = flatten_func
223223
local data, err = flatten_func(object, bucket_id, skip_nullability_check)

0 commit comments

Comments
 (0)