cgmb / guardonce

Utilities for converting from C/C++ include guards to #pragma once and back again.
MIT License
142 stars 3 forks source link

once2guard fails on files containing unicode if --endif-style specified #20

Closed cgmb closed 7 years ago

cgmb commented 7 years ago

My first encoding bug. Hurrah! once2guard silently fails to convert files containing unicode characters if --endif-style is specified. This only affects Python 2.

This seems to stem from accidentally combining unicode and str. Using either one consistently is sufficient to fix the problem.

I kind of miss static typing.

cgmb commented 7 years ago

I think this highlights that I need end-to-end tests. When there were fewer options, I actually could manually test across all Windows, Linux and OSX with both Python 2 and 3, but now it's starting to get too burdensome. I scrapped the end-to-end tests when moving to v2.0.0 because they were awkward to work with and difficult to understand, but maybe I just need to try a different approach.