-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0e9946
commit e0e4be3
Showing
2 changed files
with
33 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import textwrap | ||
import pytest | ||
|
||
from pygments.lexers.lean import Lean3Lexer, Lean4Lexer | ||
|
||
def test_lean3_import(): | ||
s = textwrap.dedent("""\ | ||
-- this is Lean 3 | ||
import data.nat.basic | ||
def foo : nat := 1 | ||
""") | ||
assert Lean3Lexer.analyse_text(s) > 0 | ||
assert Lean4Lexer.analyse_text(s) == 0 | ||
|
||
def test_lean4_import(): | ||
s = textwrap.dedent("""\ | ||
-- this is Lean 4 | ||
import Mathlib.Data.Nat.Basic | ||
def foo : Nat := 1 | ||
""") | ||
assert Lean3Lexer.analyse_text(s) == 0 | ||
assert Lean4Lexer.analyse_text(s) > 0 |