ocpi-tariffs 0.43.0

OCPI tariff calculations
Documentation
use super::{line_col, LineCol};

#[test]
fn should_line_col_empty_str() {
    let json = "";
    let LineCol { line, col } = line_col(json);
    assert_eq!(line, 0);
    assert_eq!(col, 0);
}

#[test]
fn should_line_col_one_line_one_char_str() {
    let json = "1";
    let LineCol { line, col } = line_col(json);
    assert_eq!(line, 0);
    assert_eq!(col, 1);
}

#[test]
fn should_line_col_one_line_many_chars_str() {
    let json = "1234";
    let LineCol { line, col } = line_col(json);
    assert_eq!(line, 0);
    assert_eq!(col, 4);
}

#[test]
fn should_line_col_two_line_one_col_str() {
    let json = "1234\n1";
    let LineCol { line, col } = line_col(json);
    assert_eq!(line, 1);
    assert_eq!(col, 1);
}