MCPcopy Create free account
hub / github.com/Thalhammer/jwt-cpp / TEST

Function TEST

tests/TokenFormatTest.cpp:4–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <gtest/gtest.h>
3
4TEST(TokenFormatTest, MissingDot) {
5 ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0.eyJpc3MiOiJhdXRoMCJ9"), std::invalid_argument);
6 ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0eyJpc3MiOiJhdXRoMCJ9."), std::invalid_argument);
7 ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0eyJpc3MiOiJhdXRoMCJ9"), std::invalid_argument);
8}
9
10TEST(TokenFormatTest, InvalidChar) {
11 ASSERT_THROW(jwt::decode("eyJhbGciOiJub25lIiwidHlwIjoiSldTIn0().eyJpc3MiOiJhdXRoMCJ9."), std::runtime_error);

Callers

nothing calls this directly

Calls 9

has_typeMethod · 0.80
has_issuerMethod · 0.80
has_subjectMethod · 0.80
get_issuerMethod · 0.80
get_subjectMethod · 0.80
decodeFunction · 0.50
has_algorithmMethod · 0.45
get_algorithmMethod · 0.45
get_typeMethod · 0.45

Tested by

no test coverage detected