File: integration.rs

package info (click to toggle)
rust-jql-runner 8.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 184 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use jql_parser::tokens::Token;
use jql_runner::runner::{
    raw,
    token,
};
use serde_json::json;

#[test]
fn check_raw_integration() {
    assert_eq!(
        raw(r#""a","b""#, &json!({ "a": 1, "b": 2 })),
        Ok(json!([1, 2]))
    );
}

#[test]
fn check_token_integration() {
    assert_eq!(
        token(
            &[
                Token::KeySelector("a"),
                Token::GroupSeparator,
                Token::KeySelector("b")
            ],
            &json!({ "a": 1, "b": 2 })
        ),
        Ok(json!([1, 2]))
    );
}