Skip to content

Commit

Permalink
Add tests and commentary about in non-loop contexts
Browse files Browse the repository at this point in the history
Closes #17.
  • Loading branch information
fredrikekre committed Jul 13, 2024
1 parent 806c81b commit eb7f55b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,9 @@ The keyword `in` is used consistently instead of `∈` and `=` in `for` loops. E
+for i in 1:2
```
#### Potential changes
- Since `` exists the formatted code may become asymmetric, when both `` and `` are
used, since `` is left alone and not replaced by e.g. `!(...)`. See discussion in issue
[#17](https://github.com/fredrikekre/Runic.jl/issues/17).
Note that `` not replaced when used as an operator outside of loop contexts in
order to be symmetric with `` which doesn't have a direct ASCII equivalent.
See [#17](https://github.com/fredrikekre/Runic.jl/issues/17) for more details.
### Braces around right hand side of `where`
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ end
"$(l)i for i in I, j in J if i < j$(r)"
end
end
# ∈ is still allowed when used as an operator outside of loop contexts in order to keep
# symmetry with ∉ which doesn't have a direct ascii equivalent.
# See https://github.com/fredrikekre/Runic.jl/issues/17
@test format_string("a ∈ A") == "a ∈ A"
@test format_string("a ∉ A") == "a ∉ A"
end

@testset "braces around where rhs" begin
Expand Down

1 comment on commit eb7f55b

@fredrikekre
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tecosaur I don't know if you followed the issue, but here is the resolution to it.

Please sign in to comment.