utf-8: added integration test

pull/42/head
Vladimir Serov 2020-02-09 17:53:40 +03:00
parent ee99427e9e
commit 8fd2fc2fe6
No known key found for this signature in database
GPG Key ID: 6BA7C26C3FDF7BB3
1 changed files with 15 additions and 0 deletions

View File

@ -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::<Unicode1x2>()
.dark_color(Unicode1x2::Light)
.light_color(Unicode1x2::Dark)
.module_dimensions(1, 1)
.build();
assert_eq!("█████████████████\n██ ▄▄▄▄▄ █▄▀▄█▄██\n██ █ █ █ █ ██\n██ █▄▄▄█ █▄▄██▀██\n██▄▄▄▄▄▄▄█▄▄▄▀ ██\n██▄ ▀ ▀ ▀▄▄ ████\n██▄▄▀▄█ ▀▀▀ ▀▄▄██\n██▄▄▄█▄▄█▄██▄█▄██\n▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀", image);
}