Merge branch 'add_symbolrate' of https://github.com/go2sh/units into go2sh-add_symbolrate

This commit is contained in:
Mateusz Pusz committed 2021-03-19 07:35:20 +01:00
commit 07cb258eff
3 files changed
+78 -2

No files matched your search

+15 -2
View File
@@ -20,9 +20,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <units/data/data.h>
#include <units/quantity_io.h>
#include <catch2/catch.hpp>
#include <units/data/data.h>
#include <units/format.h>
#include <units/quantity_io.h>
#include <sstream>
using namespace units::data;
@@ -62,3 +63,15 @@ TEST_CASE("operator<< on a data quantity", "[text][ostream]")
}
}
}
TEST_CASE("fmt::format on data unit symbols", "[text][fmt]")
{
SECTION("symbolrate")
{
CHECK(fmt::format("{}", 1_q_Bd) == "1 Bd");
CHECK(fmt::format("{}", 1_q_kBd) == "1 kBd");
CHECK(fmt::format("{}", 1_q_MBd) == "1 MBd");
CHECK(fmt::format("{}", 1_q_GBd) == "1 GBd");
CHECK(fmt::format("{}", 1_q_TBd) == "1 TBd");
}
}