Skip to content

Instantly share code, notes, and snippets.

@kurenaif
Created January 5, 2016 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurenaif/0369b75a3dda2c609f30 to your computer and use it in GitHub Desktop.
Save kurenaif/0369b75a3dda2c609f30 to your computer and use it in GitHub Desktop.
#include <gtest/gtest.h>
int function(int n){
int a = 1;
for(int i=1;i<=n;++i){
a *= i;
}
return a;
}
TEST(functionTest, HandlesZeroInput){
EXPECT_EQ(1, function(0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment