Mercurial > repos > public > sbplib_julia
annotate test/test_util.jl @ 1884:894bc613f61d test/type_stability
Close branch.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 28 Jan 2025 21:59:03 +0100 |
parents | e7176fb09e98 |
children |
rev | line source |
---|---|
760
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
1 function is_type_stable(f,args...) |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
2 type_stable = true |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
3 try @inferred f(args...) |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
4 catch |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
5 type_stable = false |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
6 end |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
7 return type_stable |
e7176fb09e98
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff
changeset
|
8 end |