This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-zerotierone/ext/librethinkdbxx/test/upstream/regression/546.yaml
2017-11-02 07:05:11 -07:00

28 lines
716 B
YAML

desc: Regression tests for issue #546, variable shadowing
tests:
# Just a single nesting level, for sanity
- js: r(1).do(function(a) { return a; })
py: r.expr(1).do(lambda a:a)
ot: 1
# Nested but returning the inner var
- js: |-
r(1).do(function(a) {
return r(2).do(function(b) {
return b;
});
})
py: r.expr(1).do(lambda a:r.expr(2).do(lambda b:b))
ot: 2
# Nested but returning the outer var (this was the problem in 546)
- js: |-
r(1).do(function(a) {
return r(2).do(function(b) {
return a;
});
})
py: r.expr(1).do(lambda a:r.expr(2).do(lambda b:a))
ot: 1