OneLauncher-Cracked/packages/oneclient_content/tests/file_identity.rs
oiupoyt 163eb0ac0c
Some checks are pending
Release Multiplatform Binaries / build (deb,appimage, linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-gnu) (push) Waiting to run
Release Multiplatform Binaries / build (dmg,app, macos-arm64, macos-14, aarch64-apple-darwin) (push) Waiting to run
Release Multiplatform Binaries / build (dmg,app, macos-x86_64, macos-14, x86_64-apple-darwin) (push) Waiting to run
Release Multiplatform Binaries / build (nsis, windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Release Multiplatform Binaries / create-release (push) Blocked by required conditions
feat: update base to official upstream 2.3.1 with all cracked features intact (2.3.1-c1)
- Rebased onto official Polyfrost OneLauncher v2.3.1 (commit 0e49c691)
- Preserved 100% offline authentication without requiring Microsoft accounts
- Integrated custom 3D offline skin changer with UUID character slot targeting
- Maintained CustomSkinLoader auto-configuration for Ely.by and SkinRestorer
- Maintained direct GitHub Releases auto-updater pointing to oiupoyt/OneLauncher-Cracked
- Maintained mods filter popover fix eliminating text ghosting/duplication
- Configured dev profile to prevent debug symbol bloat
2026-09-07 17:38:22 +05:30

39 lines
1.1 KiB
Rust

use oneclient_content::packages::{curseforge_fingerprint, FileIdentity};
#[test]
fn curseforge_fingerprint_ignores_padding_whitespace() {
let a = curseforge_fingerprint(b"hello");
let b = curseforge_fingerprint(b"\t\n\r hello \n\t\r");
assert_eq!(a, b);
}
#[test]
fn curseforge_fingerprint_empty_is_stable() {
assert_eq!(curseforge_fingerprint(&[]), curseforge_fingerprint(&[]));
}
#[test]
fn curseforge_fingerprint_differs_for_content() {
let a = curseforge_fingerprint(b"hello");
let b = curseforge_fingerprint(b"world");
assert_ne!(a, b);
}
#[test]
fn file_identity_from_bytes_sets_sha1_and_cf_fingerprint() {
let id = FileIdentity::from_bytes(b"test jar content");
assert_eq!(id.sha1.len(), 40);
assert!(id.cf_fingerprint.is_some());
}
#[test]
fn file_identity_from_sha1_has_no_cf_fingerprint() {
let id = FileIdentity::from_sha1("a".repeat(40));
assert!(id.cf_fingerprint.is_none());
}
#[test]
fn file_identity_with_fingerprint_roundtrip() {
let id = FileIdentity::from_sha1("abc").with_curseforge_fingerprint(12345);
assert_eq!(id.cf_fingerprint, Some(12345));
}