UPDATE: Serialize/Deserialize with bitcode (#31)

* UPDATE: Serialize/Deserialize with bitcode

Fixes #12
This commit is contained in:
Nicolás Hatcher Andrés
2024-04-11 23:45:00 +02:00
committed by GitHub
parent 489027991c
commit 196e074ef5
11 changed files with 139 additions and 51 deletions

View File

@@ -0,0 +1,26 @@
//! Tests an Excel xlsx file.
//! Returns a list of differences in json format.
//! Saves an IronCalc version
//! This is primary for QA internal testing and will be superseded by an official
//! IronCalc CLI.
//!
//! Usage: test file.xlsx
use std::path;
use ironcalc::{export::save_to_json, import::load_model_from_xlsx};
fn main() {
let args: Vec<_> = std::env::args().collect();
if args.len() != 2 {
panic!("Usage: {} <file.xlsx>", args[0]);
}
// first test the file
let file_name = &args[1];
let file_path = path::Path::new(file_name);
let base_name = file_path.file_stem().unwrap().to_str().unwrap();
let output_file_name = &format!("{base_name}.ic");
let model = load_model_from_xlsx(file_name, "en", "UTC").unwrap();
save_to_json(model.workbook, output_file_name);
}