Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Apr 29, 2024
1 parent adcc152 commit 1736757
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions test/generators/cplusplus/CplusplusGenerator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,15 @@ describe('CplusplusGenerator', () => {
members: {
oneOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }]
},
array_type: {
tuple_type: {
type: 'array',
items: [{ type: 'string' }, { type: 'number' }]
},
array_type: {
type: 'array',
items: {
oneOf: [{ type: 'string' }, { type: 'number' }]
}
}
},
patternProperties: {
Expand All @@ -100,8 +106,9 @@ describe('CplusplusGenerator', () => {
'#include <string>',
'#include <optional>',
'#include <variant>',
'#include <any>',
'#include <tuple>',
'#include <vector>',
'#include <any>',
'#include <map>'
];
const models = await generator.generate(doc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ exports[`CplusplusGenerator Class should render \`class\` type 1`] = `
double house_number;
std::optional<bool> marriage;
std::optional<std::variant<std::string, double, bool>> members;
std::tuple<std::string, double> array_type;
std::optional<std::tuple<std::string, double>> tuple_type;
std::vector<std::variant<std::string, double>> array_type;
std::optional<std::map<std::string, std::variant<std::any, std::string>>> additional_properties;
};"
`;
Expand Down

0 comments on commit 1736757

Please sign in to comment.