igumnoff / shiva

Shiva library: Implementation in Rust of a parser and generator for documents of any type
https://docs.rs/shiva
GNU General Public License v3.0
159 stars 10 forks source link

Restore /shiva/test #88

Closed evgenyigumnov closed 2 months ago

evgenyigumnov commented 2 months ago

after refactoring it is not compiled and not work

evgenyigumnov commented 2 months ago
C:\Users\igumn\shiva>git checkout main                                                                                                                                                                                                                                        Switched to branch 'main'                                                                                                                                                                                                                                                     Your branch is behind 'origin/main' by 5 commits, and can be fast-forwarded.                                                                                                                                                                                                    (use "git pull" to update your local branch)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              C:\Users\igumn\shiva>bash                                                                                                                                                                                                                                                     
igumn@lenovo MINGW64 ~/shiva (main)
$ cd test

igumn@lenovo MINGW64 ~/shiva/test (main)
$ cargo test
    Updating crates.io index
   Compiling log v0.4.21
   Compiling fontdb v0.16.2
   Compiling simplecss v0.2.1
   Compiling usvg-text-layout v0.38.0
   Compiling usvg-parser v0.38.0
   Compiling tiny-skia v0.11.4
   Compiling zopfli v0.8.1
   Compiling markup5ever v0.11.0
   Compiling rustls v0.22.4
   Compiling selectors v0.25.0
   Compiling calamine v0.24.0
   Compiling lopdf v0.32.0
   Compiling serde-xml-rs v0.6.0
   Compiling usvg v0.38.0
   Compiling zip v2.1.3
   Compiling typst v0.11.1
   Compiling html5ever v0.26.0
   Compiling resvg v0.38.0
   Compiling shiva-spreadsheet-ods v0.0.2
   Compiling svg2pdf v0.10.0
   Compiling scraper v0.19.0
   Compiling ureq v2.9.7
   Compiling typst-pdf v0.11.1
   Compiling shiva v1.0.0 (C:\Users\igumn\shiva\lib)
   Compiling test v0.1.0 (C:\Users\igumn\shiva\test)
error[E0061]: this function takes 1 argument but 2 arguments were supplied
  --> test\src\html.rs:25:32
   |
25 |         let parsed: Document = Transformer::parse(&html_document.as_bytes().into(), &HashMap::new())?;
   |                                ^^^^^^^^^^^^^^^^^^                                 -----------------
   |                                                                                   | |
   |                                                                                   | unexpected argument of type `&HashMap<_, _>`
   |                                                                                   help: remove the extra argument
   |
note: associated function defined here
  --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
   |
39 |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
   |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
  --> test\src\html.rs:93:67
   |
93 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
   |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:115:32
    |
115 |         let parsed: Document = Transformer::parse(&html_document.as_bytes().into(), &HashMap::new())?;
    |                                ^^^^^^^^^^^^^^^^^^                                 -----------------
    |                                                                                   | |
    |                                                                                   | unexpected argument of type `&HashMap<_, _>`
    |                                                                                   help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:208:67
    |
208 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:234:32
    |
234 |         let parsed: Document = Transformer::parse(&html_document.as_bytes().into(), &HashMap::new())?;
    |                                ^^^^^^^^^^^^^^^^^^                                 -----------------
    |                                                                                   | |
    |                                                                                   | unexpected argument of type `&HashMap<_, _>`
    |                                                                                   help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:298:67
    |
298 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:326:32
    |
326 |         let parsed: Document = Transformer::parse(&html_document.as_bytes().into(), &HashMap::new())?;
    |                                ^^^^^^^^^^^^^^^^^^                                 -----------------
    |                                                                                   | |
    |                                                                                   | unexpected argument of type `&HashMap<_, _>`
    |                                                                                   help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:417:67
    |
417 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:434:55
    |
434 |         let parsed: Result<Document, anyhow::Error> = Transformer::parse(&html_document.as_bytes().into(), &HashMap::new());    assert!(parsed.is_ok());
    |                                                       ^^^^^^^^^^^^^^^^^^                                 -----------------
    |                                                                                                          | |
    |                                                                                                          | unexpected argument of type `&HashMap<_, _>`
    |                                                                                                          help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:486:67
    |
486 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:501:55
    |
501 |         let parsed: Result<Document, anyhow::Error> = Transformer::parse(&html_document.as_bytes().into(), &HashMap::new());    assert!(parsed.is_ok());
    |                                                       ^^^^^^^^^^^^^^^^^^                                 -----------------
    |                                                                                                          | |
    |                                                                                                          | unexpected argument of type `&HashMap<_, _>`
    |                                                                                                          help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:567:67
    |
567 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:582:55
    |
582 |         let parsed: Result<Document, anyhow::Error> = Transformer::parse(&html_str.as_bytes().into(), &HashMap::new());
    |                                                       ^^^^^^^^^^^^^^^^^^                            -----------------
    |                                                                                                     | |
    |                                                                                                     | unexpected argument of type `&HashMap<_, _>`
    |                                                                                                     help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:614:55
    |
614 |         let parsed: Result<Document, anyhow::Error> = Transformer::parse(&html_str.as_bytes().into(), &HashMap::new());
    |                                                       ^^^^^^^^^^^^^^^^^^                            -----------------
    |                                                                                                     | |
    |                                                                                                     | unexpected argument of type `&HashMap<_, _>`
    |                                                                                                     help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:630:67
    |
630 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:645:55
    |
645 |         let parsed: Result<Document, anyhow::Error> = Transformer::parse(&html_str.as_bytes().into(), &HashMap::new());
    |                                                       ^^^^^^^^^^^^^^^^^^                            -----------------
    |                                                                                                     | |
    |                                                                                                     | unexpected argument of type `&HashMap<_, _>`
    |                                                                                                     help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> test\src\html.rs:677:55
    |
677 |         let parsed: Result<Document, anyhow::Error> = Transformer::parse(&html_str.as_bytes().into(), &HashMap::new());
    |                                                       ^^^^^^^^^^^^^^^^^^                            -----------------
    |                                                                                                     | |
    |                                                                                                     | unexpected argument of type `&HashMap<_, _>`
    |                                                                                                     help: remove the extra argument
    |
note: associated function defined here
   --> C:\Users\igumn\shiva\lib\src\core.rs:39:8
    |
39  |     fn parse(document: &Bytes) -> anyhow::Result<Document>;
    |        ^^^^^

error[E0609]: no field `0` on type `bytes::Bytes`
   --> test\src\html.rs:693:67
    |
693 |         let generated_text = std::str::from_utf8(&generated_bytes.0)?;
    |                                                                   ^ unknown field

Some errors have detailed explanations: E0061, E0609.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `test` (bin "test" test) due to 18 previous errors