I try to use .feature files with the language option and found 2 bugs.
extern "C" {
typedef struct Utf8Source Utf8Source;
long UnicodeUtilities_read_code_point_from_utf8_source(Utf8Source* utf8_source);
Utf8Source* FileUtf8Source_new(FILE* file);
unsigned char Utf8Source_read(Utf8Source* utf8_source);
void Utf8Source_delete(Utf8Source* utf8_source);
}
inline std::wstring read_file(const std::string &feature) {
FILE* file = fopen(feature.c_str(), "rb");
if (!file) {
throw std::runtime_error("File \"" + feature + "\" not found!");
}
std::wstring r;
Utf8Source* utf8_source = FileUtf8Source_new(file);
for(;;) {
long code = UnicodeUtilities_read_code_point_from_utf8_source(utf8_source);
if (code == WEOF) break;
r+=(wchar_t)code;
}
Utf8Source_delete(utf8_source);
fclose(file);
return r;
}
I try to use .feature files with the language option and found 2 bugs.
std::string keyword = children["type"];I fixed this bug using UnicodeUtilities_read_code_point_from_utf8_source from gherkin-c library.