Skip to content

Commit

Permalink
tests: Fix mypy error in global.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Jul 4, 2021
1 parent d5ef9c3 commit e2dcec1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 19 deletions.
5 changes: 2 additions & 3 deletions tests/cases/global.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3


code_0 = 0
code_1 = 1

Expand All @@ -14,8 +13,8 @@
if __name__ == "__main__":
for i in l_a:
print(i)
for i in l_b:
print(i)
for j in l_b:
print(j)
# test for container membership
if "a" in ["a", "b"]:
print("OK")
4 changes: 2 additions & 2 deletions tests/expected/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ int main(int argc, char** argv) {
std::cout << i;
std::cout << std::endl;
}
for (auto i : l_b) {
std::cout << i;
for (auto j : l_b) {
std::cout << j;
std::cout << std::endl;
}
if (({
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ main(List<String> argv) {
for (final i in l_a) {
print(sprintf("%s", [i]));
}
for (final i in l_b) {
print(sprintf("%s", [i]));
for (final j in l_b) {
print(sprintf("%s", [j]));
}

if (["a", "b"].contains("a")) {
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func main() {
for _, i := range LA {
fmt.Printf("%v\n", i)
}
for _, i := range LB {
fmt.Printf("%v\n", i)
for _, j := range LB {
fmt.Printf("%v\n", j)
}
if pygo.Contains([]string{"a", "b"}, "a") {
fmt.Printf("%v\n", "OK")
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/global.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function main()
for i in l_a
println(join([i], " "))
end
for i in l_b
println(join([i], " "))
for j in l_b
println(join([j], " "))
end
if "a" in ["a", "b"]
println(join(["OK"], " "))
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/global.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ fun main(argv: Array<String>) {
for (i in l_a) {
println("$i")
}
for (i in l_b) {
println("$i")
for (j in l_b) {
println("$j")
}
if ("a" in arrayOf("a", "b")) {
println("OK")
Expand Down
4 changes: 2 additions & 2 deletions tests/expected/global.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let l_b = @[code_a, code_b]
proc main() =
for i in l_a:
echo i
for i in l_b:
echo i
for j in l_b:
echo j
if "a" in @["a", "b"]:
echo "OK"

Expand Down
4 changes: 2 additions & 2 deletions tests/expected/global.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if __name__ == "__main__":
for i in l_a:
print(i)
for i in l_b:
print(i)
for j in l_b:
print(j)
if "a" in ["a", "b"]:
print("OK")
4 changes: 2 additions & 2 deletions tests/expected/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pub fn main() -> Result<()> {
for i in l_a {
println!("{}", *i);
}
for i in l_b {
println!("{}", *i);
for j in l_b {
println!("{}", *j);
}
if vec!["a", "b"].iter().any(|&x| x == "a") {
println!("{}", "OK");
Expand Down

0 comments on commit e2dcec1

Please sign in to comment.