feat: other snapshots and ci
This commit is contained in:
parent
8e295e06e1
commit
0fb164d310
4 changed files with 292 additions and 0 deletions
95
.github/workflows/ci.yml
vendored
Normal file
95
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- 1.60.0 # MSRV from Cargo.toml
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
- name: Run tests with all features
|
||||
run: cargo test --all-features --verbose
|
||||
|
||||
feature-tests:
|
||||
name: Feature Tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
features:
|
||||
- "text"
|
||||
- "unicode"
|
||||
- "bytes"
|
||||
- "inline"
|
||||
- "serde"
|
||||
- "text,unicode"
|
||||
- "text,bytes"
|
||||
- "text,inline"
|
||||
- "text,serde"
|
||||
- "text,unicode,bytes"
|
||||
- "text,unicode,inline"
|
||||
- "text,unicode,serde"
|
||||
- "text,bytes,inline"
|
||||
- "text,bytes,serde"
|
||||
- "text,inline,serde"
|
||||
- "unicode,bytes,inline,serde"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Test with features ${{ matrix.features }}
|
||||
run: cargo test --features ${{ matrix.features }} --verbose
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Run clippy
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
- name: Run rustfmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
docs:
|
||||
name: Docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Check documentation
|
||||
run: cargo doc --all-features --no-deps --document-private-items
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
106
src/text/snapshots/likewise__text__inline__serde.snap
Normal file
106
src/text/snapshots/likewise__text__inline__serde.snap
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
---
|
||||
source: src/text/inline.rs
|
||||
expression: "&json"
|
||||
---
|
||||
[
|
||||
{
|
||||
"tag": "insert",
|
||||
"old_index": null,
|
||||
"new_index": 0,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"Stuff\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "equal",
|
||||
"old_index": 0,
|
||||
"new_index": 1,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"Hello World\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 1,
|
||||
"new_index": null,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"some "
|
||||
],
|
||||
[
|
||||
false,
|
||||
"stuff here\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "insert",
|
||||
"old_index": null,
|
||||
"new_index": 2,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"some "
|
||||
],
|
||||
[
|
||||
true,
|
||||
"amazing "
|
||||
],
|
||||
[
|
||||
false,
|
||||
"stuff here\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "equal",
|
||||
"old_index": 2,
|
||||
"new_index": 3,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"some more stuff here\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 3,
|
||||
"new_index": null,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 4,
|
||||
"new_index": null,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"Aha stuff here\n"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 5,
|
||||
"new_index": null,
|
||||
"values": [
|
||||
[
|
||||
false,
|
||||
"and more stuff"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
54
src/text/snapshots/likewise__text__serde.snap
Normal file
54
src/text/snapshots/likewise__text__serde.snap
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
source: src/text/mod.rs
|
||||
expression: "&json"
|
||||
---
|
||||
[
|
||||
{
|
||||
"tag": "insert",
|
||||
"old_index": null,
|
||||
"new_index": 0,
|
||||
"value": "Stuff\n"
|
||||
},
|
||||
{
|
||||
"tag": "equal",
|
||||
"old_index": 0,
|
||||
"new_index": 1,
|
||||
"value": "Hello World\n"
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 1,
|
||||
"new_index": null,
|
||||
"value": "some stuff here\n"
|
||||
},
|
||||
{
|
||||
"tag": "insert",
|
||||
"old_index": null,
|
||||
"new_index": 2,
|
||||
"value": "some amazing stuff here\n"
|
||||
},
|
||||
{
|
||||
"tag": "equal",
|
||||
"old_index": 2,
|
||||
"new_index": 3,
|
||||
"value": "some more stuff here\n"
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 3,
|
||||
"new_index": null,
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 4,
|
||||
"new_index": null,
|
||||
"value": "Aha stuff here\n"
|
||||
},
|
||||
{
|
||||
"tag": "delete",
|
||||
"old_index": 5,
|
||||
"new_index": null,
|
||||
"value": "and more stuff"
|
||||
}
|
||||
]
|
||||
37
src/text/snapshots/likewise__text__serde_ops.snap
Normal file
37
src/text/snapshots/likewise__text__serde_ops.snap
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
source: src/text/mod.rs
|
||||
expression: "&json"
|
||||
---
|
||||
[
|
||||
{
|
||||
"op": "insert",
|
||||
"old_index": 0,
|
||||
"new_index": 0,
|
||||
"new_len": 1
|
||||
},
|
||||
{
|
||||
"op": "equal",
|
||||
"old_index": 0,
|
||||
"new_index": 1,
|
||||
"len": 1
|
||||
},
|
||||
{
|
||||
"op": "replace",
|
||||
"old_index": 1,
|
||||
"old_len": 1,
|
||||
"new_index": 2,
|
||||
"new_len": 1
|
||||
},
|
||||
{
|
||||
"op": "equal",
|
||||
"old_index": 2,
|
||||
"new_index": 3,
|
||||
"len": 1
|
||||
},
|
||||
{
|
||||
"op": "delete",
|
||||
"old_index": 3,
|
||||
"old_len": 3,
|
||||
"new_index": 4
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue