Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data/fin/vec_notation): add has_reflect instance and tests (#14670)
- Loading branch information
1 parent
764d7a9
commit fee91d7
Showing
2 changed files
with
29 additions
and
1 deletion.
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,22 @@ | ||
import data.fin.vec_notation | ||
|
||
/-! These tests are testing `pi_fin.reflect` and fail with | ||
`local attribute [-instance] pi_fin.reflect` -/ | ||
|
||
#eval do | ||
let x : fin 0 → ℕ := ![], | ||
tactic.is_def_eq `(x) `(![] : fin 0 → ℕ) | ||
|
||
#eval do | ||
let x := ![1, 2, 3], | ||
tactic.is_def_eq `(x) `(![1, 2, 3]) | ||
|
||
#eval do | ||
let x := ![![1, 2], ![3, 4]], | ||
tactic.is_def_eq `(x) `(![![1, 2], ![3, 4]]) | ||
|
||
/-! These tests are testing `pi_fin.has_repr` -/ | ||
|
||
#eval show tactic unit, from guard (repr (![] : _ → ℕ) = "![]") | ||
#eval show tactic unit, from guard (repr ![1, 2, 3] = "![1, 2, 3]") | ||
#eval show tactic unit, from guard (repr ![![1, 2], ![3, 4]] = "![![1, 2], ![3, 4]]") |