From 59980a3b6b2eb0b5e012148334cce8e6533e8ffd Mon Sep 17 00:00:00 2001 From: Vladimir Serov Date: Sun, 9 Feb 2020 17:53:40 +0300 Subject: [PATCH] utf-8: added integration test --- src/render/utf8.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/render/utf8.rs b/src/render/utf8.rs index ffc8530..6d790d7 100644 --- a/src/render/utf8.rs +++ b/src/render/utf8.rs @@ -93,3 +93,18 @@ fn test_render_to_utf8_string() { assert_eq!(&image2, " \n ██ \n ██ \n "); } + +#[test] +fn integration_render_utf8_1x2() { + use crate::{QrCode, Version, EcLevel}; + use crate::render::utf8::Unicode1x2; + + let code = QrCode::with_version(b"12345678", Version::Micro(2), EcLevel::L).unwrap(); + let image = code.render::() + .dark_color(Unicode1x2::Light) + .light_color(Unicode1x2::Dark) + .module_dimensions(1, 1) + .build(); + assert_eq!("█████████████████\n██ ▄▄▄▄▄ █▄▀▄█▄██\n██ █ █ █ █ ██\n██ █▄▄▄█ █▄▄██▀██\n██▄▄▄▄▄▄▄█▄▄▄▀ ██\n██▄ ▀ ▀ ▀▄▄ ████\n██▄▄▀▄█ ▀▀▀ ▀▄▄██\n██▄▄▄█▄▄█▄██▄█▄██\n▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀", image); + +} \ No newline at end of file