Skip to content

Commit 1ee60c5

Browse files
committed
chore: add tests about coercion behaviour
1 parent 43f3a98 commit 1ee60c5

1 file changed

Lines changed: 96 additions & 2 deletions

File tree

MathlibTest/DifferentialGeometry/Elaborators.lean

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ Note: Expected a function because this term is being applied to the argument
371371
#guard_msgs in
372372
#check CMDiff[s] 2 f m
373373

374-
variable {n : WithTop ℕ∞} {k : ℕ} {k' : ℕ∞}
374+
variable {n : WithTop ℕ∞}
375375
/--
376376
error: Function expected at
377377
ContMDiffOn I I' n f s
@@ -405,7 +405,101 @@ end
405405
-- Tests for coercions from ℕ or ℕ∞ to Withtop ℕ∞.
406406
-- TODO: decide on the correct behaviour and update the tests accordingly!
407407
section coercions
408-
-- TODO: add them
408+
409+
variable {k : ℕ} {k' : ℕ∞}
410+
411+
/-- info: ContMDiffWithinAt I I' 0 f s : M → Prop -/
412+
#guard_msgs in
413+
#check CMDiffAt[s] 0 f
414+
415+
/-- info: ContMDiffWithinAt I I' 1 f s : M → Prop -/
416+
#guard_msgs in
417+
#check CMDiffAt[s] 1 f
418+
419+
/-- info: ContMDiffWithinAt I I' 37 f s : M → Prop -/
420+
#guard_msgs in
421+
#check CMDiffAt[s] 37 f
422+
423+
/--
424+
error: Application type mismatch: In the application
425+
ContMDiffWithinAt I I' k
426+
the argument
427+
k
428+
has type
429+
ℕ : Type
430+
but is expected to have type
431+
WithTop ℕ∞ : Type
432+
-/
433+
#guard_msgs in
434+
#check CMDiffAt[s] k f
435+
436+
/--
437+
error: Application type mismatch: In the application
438+
ContMDiffWithinAt I I' k'
439+
the argument
440+
k'
441+
has type
442+
ℕ∞ : Type
443+
but is expected to have type
444+
WithTop ℕ∞ : Type
445+
-/
446+
#guard_msgs in
447+
#check CMDiffAt[s] k' f m
448+
449+
/-- info: ContMDiffWithinAt I I' n f s m : Prop -/
450+
#guard_msgs in
451+
#check CMDiffAt[s] n f m
452+
453+
/-- info: ContMDiffAt I I' (↑k) f : M → Prop -/
454+
#guard_msgs in
455+
#check CMDiffAt k f
456+
457+
/-- info: ContMDiffAt I I' (↑k') f m : Prop -/
458+
#guard_msgs in
459+
#check CMDiffAt k' f m
460+
461+
/-- info: ContMDiffOn I I' (↑k) f s : Prop -/
462+
#guard_msgs in
463+
#check CMDiff[s] k f
464+
465+
/--
466+
error: Function expected at
467+
ContMDiffOn I I' (↑k') f s
468+
but this term has type
469+
Prop
470+
471+
Note: Expected a function because this term is being applied to the argument
472+
m
473+
-/
474+
#guard_msgs in
475+
#check CMDiff[s] k' f m
476+
477+
/--
478+
error: Application type mismatch: In the application
479+
ContMDiff I I' k
480+
the argument
481+
k
482+
has type
483+
ℕ : Type
484+
but is expected to have type
485+
WithTop ℕ∞ : Type
486+
-/
487+
#guard_msgs in
488+
#check CMDiff k f
489+
490+
/--
491+
error: Application type mismatch: In the application
492+
ContMDiff I I' k'
493+
the argument
494+
k'
495+
has type
496+
ℕ∞ : Type
497+
but is expected to have type
498+
WithTop ℕ∞ : Type
499+
-/
500+
#guard_msgs in
501+
#check CMDiff k' f m
502+
409503
end coercions
410504

411505
-- Function from a manifold into a normed space.

0 commit comments

Comments
 (0)