Skip to content

Update tests of variable-length-quantity #2086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions bin/checkout_pinned_problem_specifications_commit.sh

This file was deleted.

29 changes: 0 additions & 29 deletions bin/configlet_wrapper.sh

This file was deleted.

9 changes: 8 additions & 1 deletion bin/symlink_problem_specifications.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail

# This script creates a symlink to the problem-specifications cache used
# by configlet. When working on an exercise, it is handy to have the
# problem-specifions files in reach. Symlinking to configlet's cache ensures
# you're always looking at the up-to-date files.

cd "$(git rev-parse --show-toplevel)"

[ -e "problem-specifications" ] || ln -s "$(./bin/get_problem_specifications_dir.sh)" "problem-specifications"

./bin/checkout_pinned_problem_specifications_commit.sh
# ensure populated cache
[ -f ./bin/configlet ] || ./bin/fetch-configlet
./bin/configlet info &> /dev/null

for exercise in exercises/practice/*; do
name="$(basename "$exercise")"
Expand Down
15 changes: 0 additions & 15 deletions bin/update_problem_specifications.sh

This file was deleted.

15 changes: 15 additions & 0 deletions exercises/practice/variable-length-quantity/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ description = "Encode a series of integers, producing a series of bytes. -> zero
[be44d299-a151-4604-a10e-d4b867f41540]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary single byte"

[890bc344-cb80-45af-b316-6806a6971e81]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric single byte"

[ea399615-d274-4af6-bbef-a1c23c9e1346]
description = "Encode a series of integers, producing a series of bytes. -> largest single byte"

Expand All @@ -24,6 +27,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[63955a49-2690-4e22-a556-0040648d6b2d]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary double byte"

[4977d113-251b-4d10-a3ad-2f5a7756bb58]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric double byte"

[29da7031-0067-43d3-83a7-4f14b29ed97a]
description = "Encode a series of integers, producing a series of bytes. -> largest double byte"

Expand All @@ -33,6 +39,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[5df0bc2d-2a57-4300-a653-a75ee4bd0bee]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary triple byte"

[6731045f-1e00-4192-b5ae-98b22e17e9f7]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric triple byte"

[f51d8539-312d-4db1-945c-250222c6aa22]
description = "Encode a series of integers, producing a series of bytes. -> largest triple byte"

Expand All @@ -42,6 +51,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[11ed3469-a933-46f1-996f-2231e05d7bb6]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quadruple byte"

[b45ef770-cbba-48c2-bd3c-c6362679516e]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quadruple byte"

[d5f3f3c3-e0f1-4e7f-aad0-18a44f223d1c]
description = "Encode a series of integers, producing a series of bytes. -> largest quadruple byte"

Expand All @@ -51,6 +63,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[5f34ff12-2952-4669-95fe-2d11b693d331]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quintuple byte"

[9be46731-7cd5-415c-b960-48061cbc1154]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quintuple byte"

[7489694b-88c3-4078-9864-6fe802411009]
description = "Encode a series of integers, producing a series of bytes. -> maximum 32-bit integer input"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ fn arbitrary_single_byte() {
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn asymmetric_single_byte() {
let input = &[83];
let output = vlq::to_bytes(input);
let expected = vec![0x53];
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn largest_single_byte() {
Expand Down Expand Up @@ -44,6 +53,15 @@ fn arbitrary_double_byte() {
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn asymmetric_double_byte() {
let input = &[173];
let output = vlq::to_bytes(input);
let expected = vec![0x81, 0x2d];
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn largest_double_byte() {
Expand Down Expand Up @@ -71,6 +89,15 @@ fn arbitrary_triple_byte() {
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn asymmetric_triple_byte() {
let input = &[120_220];
let output = vlq::to_bytes(input);
let expected = vec![0x87, 0xab, 0x1c];
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn largest_triple_byte() {
Expand Down Expand Up @@ -98,6 +125,15 @@ fn arbitrary_quadruple_byte() {
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn asymmetric_quadruple_byte() {
let input = &[3_503_876];
let output = vlq::to_bytes(input);
let expected = vec![0x81, 0xd5, 0xee, 0x4];
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn largest_quadruple_byte() {
Expand Down Expand Up @@ -125,6 +161,15 @@ fn arbitrary_quintuple_byte() {
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn asymmetric_quintuple_byte() {
let input = &[2_254_790_917];
let output = vlq::to_bytes(input);
let expected = vec![0x88, 0xb3, 0x95, 0xc2, 0x5];
assert_eq!(output, expected);
}

#[test]
#[ignore]
fn maximum_32_bit_integer_input() {
Expand Down
9 changes: 3 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
_default:
just --list --unsorted

# configlet wrapper, uses pinned problem-specifications commit
# configlet (downloads if necessary)
@configlet *args="":
./bin/configlet_wrapper.sh {{ args }}

# update the pinned commit hash
update-problem-specs:
./bin/update_problem_specifications.sh
[ -f ./bin/configlet ] || ./bin/fetch-configlet
./bin/configlet {{ args }}

# generate a new uuid straight to your clipboard
uuid:
Expand Down
31 changes: 0 additions & 31 deletions rust-tooling/generate/tests/tera_templates_are_in_sync.rs

This file was deleted.