Skip to content

Commit

Permalink
Check return type is double (Issue #1805)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbales2 committed Mar 7, 2021
1 parent d0ef98c commit da82b67
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/math/prim/fun/rep_matrix_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ TEST(MathMatrixPrimMat, rep_matrix) {
EXPECT_THROW(rep_matrix(2.0, 3, -1), std::domain_error);
}

TEST(MathMatrixPrimMat, rep_matrix_always_returns_double) {
int a = 1;
auto x = stan::math::rep_matrix(a, 3, 4);

EXPECT_TRUE((std::is_same<double, stan::value_type_t<decltype(x)>>::value));
}

TEST(MathMatrixPrimMat, rep_matrix_vec) {
using stan::math::rep_matrix;
Eigen::Matrix<double, Eigen::Dynamic, 1> v(3);
Expand Down

0 comments on commit da82b67

Please sign in to comment.