Commits on Source (4)
This diff is collapsed.
[package] [package]
name = "ruled-labels" name = "ruled-labels"
version = "0.4.0" version = "0.5.0"
edition = "2021" edition = "2021"
license-file = "LICENSE" license-file = "LICENSE"
description = "Utility to check labels" description = "Utility to check labels"
......
# Ruled Labels # Ruled Labels
![badge](https://github.com/chevdor/ruled_labels/actions/workflows/quick-check.yml/badge.svg?branch=master) <figure>
<img src="https://github.com/chevdor/ruled_labels/actions/workflows/quick-check.yml/badge.svg?branch=master" alt="badge" />
</figure>
## Intro ## Intro
......
...@@ -16,6 +16,7 @@ GEM ...@@ -16,6 +16,7 @@ GEM
PLATFORMS PLATFORMS
x86_64-darwin-20 x86_64-darwin-20
x86_64-darwin-22
DEPENDENCIES DEPENDENCIES
asciidoctor-revealjs asciidoctor-revealjs
...@@ -23,4 +24,4 @@ DEPENDENCIES ...@@ -23,4 +24,4 @@ DEPENDENCIES
tilt (~> 2.0) tilt (~> 2.0)
BUNDLED WITH BUNDLED WITH
2.2.33 2.4.6
...@@ -64,14 +64,14 @@ slides: ...@@ -64,14 +64,14 @@ slides:
just -d doc/slides --justfile doc/slides/justfile present just -d doc/slides --justfile doc/slides/justfile present
# Build and tag the docker images # Build and tag the docker images
docker_build: container_build:
docker build -t {{ CLI_NAME }} -t chevdor/{{ CLI_NAME }} -t chevdor/{{ CLI_NAME }}:{{ VERSION }} . podman build -t {{ CLI_NAME }} -t docker.io/chevdor/{{ CLI_NAME }} -t docker.io/chevdor/{{ CLI_NAME }}:{{ VERSION }} .
docker images | grep {{ CLI_NAME }} podman images | grep {{ CLI_NAME }}
# Push the docker image # Push the podman image
docker_push: container_push:
docker push chevdor/{{ CLI_NAME }} podman push docker.io/chevdor/{{ CLI_NAME }}
docker push chevdor/{{ CLI_NAME }}:{{ VERSION }} podman push docker.io/chevdor/{{ CLI_NAME }}:{{ VERSION }}
git_tag: git_tag:
git tag v{{ VERSION }} -f git tag v{{ VERSION }} -f
......
...@@ -251,10 +251,39 @@ mod test_label_id { ...@@ -251,10 +251,39 @@ mod test_label_id {
assert_eq!("B0", LabelId::from_str("B0").unwrap().to_string()); assert_eq!("B0", LabelId::from_str("B0").unwrap().to_string());
} }
#[test]
fn test_misc() {
assert_eq!("B0", LabelId::from_str("B0 - foo").unwrap().to_string());
assert_eq!("B0", LabelId::from_str("B0-foo").unwrap().to_string());
assert_eq!("B0", LabelId::from_str("B0 -foo").unwrap().to_string());
assert_eq!("B0", LabelId::from_str("B0- foo").unwrap().to_string());
assert_eq!("B0", LabelId::from_str("B0 - foo").unwrap().to_string());
assert_eq!("B0", LabelId::from_str("B0 - foo bar").unwrap().to_string());
assert_eq!("B0", LabelId::from_str("B0 - foo bar 😊😊😊").unwrap().to_string());
}
#[test] #[test]
fn test_from_str() { fn test_from_str() {
let id = LabelId::from_str("B1").unwrap(); let id = LabelId::from_str("B1").unwrap();
assert_eq!('B', id.letter); assert_eq!('B', id.letter);
assert_eq!(1, id.number); assert_eq!(1, id.number);
} }
#[test]
fn test_b42() {
assert_eq!("B42", LabelId::from_str("B42").unwrap().to_string());
assert_eq!("B42", LabelId::from_str("B0042").unwrap().to_string());
assert_eq!("B42", LabelId::from_str("b0042").unwrap().to_string());
}
#[test]
fn test_b255() {
assert_eq!("B255", LabelId::from_str("B255").unwrap().to_string());
}
#[test]
#[should_panic]
fn test_b256() {
let _ = LabelId::from_str("B256");
}
} }