3#include <catch2/catch_all.hpp>
7TEST_CASE(
"Assignment::Assignment()",
"[Protocol][Protocol::Message]")
14 auto identifier = GENERATE(
15 "x",
"it",
"long_identifier",
"sequence_identifier[4]",
"nested_sequence_identifier[4][423]");
23 GENERATE(
"",
" ",
" x",
"2",
"4x",
"identifier with space",
"identifier-with-dash");
28TEST_CASE(
"Assignment<int>::hasInt()",
"[Protocol][Protocol::Message]")
30 auto identifier = GENERATE(
"x",
"it",
"long_identifier");
31 auto value = GENERATE(42, 5, 32121);
39TEST_CASE(
"Assignment<double>::hasDouble()",
"[Protocol][Protocol::Message]")
41 auto identifier = GENERATE(
"x",
"it",
"long_identifier");
42 auto value = GENERATE(42.0123, 5.0, 32121.9999);
50TEST_CASE(
"Assignment<string>::hasString()",
"[Protocol][Protocol::Message]")
52 auto identifier = GENERATE(
"x",
"it",
"long_identifier");
53 auto value = GENERATE(
"c",
"longer",
"long_string_with_underscores",
"5è4?-é");
Protocol assignment operation representation.
std::variant< int, double, std::string > protocol_value_t
Variant type representing protocol values that can be one of several types.
Represents an assignment operation in the protocol.
irsol::types::protocol_value_t value
The value assigned to the identifier (int, double, or string).
std::string identifier
The variable or parameter name being assigned.
CHECK(m.identifier==identifier)
CHECK_FALSE(m.hasDouble())
irsol::protocol::Assignment m(identifier, value)
CHECK_THROWS_AS(irsol::protocol::Assignment(identifier, value), std::invalid_argument)