tangled
alpha
login
or
join now
microcosm.blue
/
microcosm-rs
65
fork
atom
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
65
fork
atom
overview
issues
8
pulls
2
pipelines
add checks or whatever
bad-example.com
1 year ago
3dfadffd
1a7278a2
+47
-3
4 changed files
expand all
collapse all
unified
split
.github
workflows
checks.yml
Makefile
rust-toolchain.toml
src
did.rs
+29
.github/workflows/checks.yml
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
name: checks
2
+
3
+
on:
4
+
push:
5
+
branches: [ main ]
6
+
pull_request:
7
+
branches: [ main ]
8
+
9
+
env:
10
+
CARGO_TERM_COLOR: always
11
+
12
+
jobs:
13
+
test:
14
+
runs-on: ubuntu-latest
15
+
steps:
16
+
- uses: actions/checkout@v4
17
+
- name: Build lib
18
+
run: cargo build --verbose
19
+
- name: Run tests
20
+
run: cargo test --verbose
21
+
22
+
style:
23
+
runs-on: ubuntu-latest
24
+
steps:
25
+
- uses: actions/checkout@v4
26
+
- name: fmt
27
+
run: cargo fmt --all -- --check
28
+
- name: clippy
29
+
run: cargo clippy --all-targets --all-features -- -D warnings
+13
Makefile
···
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
.PHONY: check test fmt clippy
2
+
all: check
3
+
4
+
test:
5
+
cargo test
6
+
7
+
fmt:
8
+
cargo fmt --all
9
+
10
+
clippy:
11
+
cargo clippy --all-targets --all-features -- -D warnings
12
+
13
+
check: test fmt clippy
+2
rust-toolchain.toml
···
0
0
···
1
+
[toolchain]
2
+
components = [ "rustfmt", "clippy" ]
+3
-3
src/did.rs
···
115
#[test]
116
fn test_doc_exmples_atproto() {
117
// https://atproto.com/specs/did#at-protocol-did-identifier-syntax
118
-
for case in vec!["did:plc:z72i7hdynmk6r22z27h6tvur", "did:web:blueskyweb.xyz"] {
119
assert!(parse_did(case).is_some(), "should pass: {case}")
120
}
121
}
···
123
#[test]
124
fn test_doc_exmples_lexicon() {
125
// https://atproto.com/specs/did#at-protocol-did-identifier-syntax
126
-
for case in vec![
127
"did:method:val:two",
128
"did:m:v",
129
"did:method::::val",
···
137
#[test]
138
fn test_doc_exmples_invalid() {
139
// https://atproto.com/specs/did#at-protocol-did-identifier-syntax
140
-
for case in vec![
141
"did:METHOD:val",
142
"did:m123:val",
143
"DID:method:val",
···
115
#[test]
116
fn test_doc_exmples_atproto() {
117
// https://atproto.com/specs/did#at-protocol-did-identifier-syntax
118
+
for case in ["did:plc:z72i7hdynmk6r22z27h6tvur", "did:web:blueskyweb.xyz"] {
119
assert!(parse_did(case).is_some(), "should pass: {case}")
120
}
121
}
···
123
#[test]
124
fn test_doc_exmples_lexicon() {
125
// https://atproto.com/specs/did#at-protocol-did-identifier-syntax
126
+
for case in [
127
"did:method:val:two",
128
"did:m:v",
129
"did:method::::val",
···
137
#[test]
138
fn test_doc_exmples_invalid() {
139
// https://atproto.com/specs/did#at-protocol-did-identifier-syntax
140
+
for case in [
141
"did:METHOD:val",
142
"did:m123:val",
143
"DID:method:val",