Skip to content
Merged
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
15 changes: 8 additions & 7 deletions crates/perry-hir/tests/unimplemented_api_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ fn crypto_subtle_digest_compiles() {
);
}

/// Out-of-scope subtle methods (encrypt/decrypt/generateKey/etc., #561's
/// "Out of scope" section) must reject with a clear message naming the
/// supported surface.
/// crypto.subtle.encrypt now compiles after PR #952 added AES-GCM
/// support (and AES-CBC lowering through the same WebCryptoEncrypt
/// HIR variant). The pre-#952 "out of scope, must reject" assertion
/// has flipped — exercise the modern compile-success path so a
/// regression in the lowering would surface here.
#[test]
fn crypto_subtle_encrypt_is_rejected() {
fn crypto_subtle_encrypt_compiles() {
let result = lower_result(
r#"
import * as crypto from "crypto";
Expand All @@ -71,10 +73,9 @@ fn crypto_subtle_encrypt_is_rejected() {
}
"#,
);
let err = result.expect_err("crypto.subtle.encrypt should reject");
assert!(
err.contains("crypto.subtle.encrypt") && err.contains("not implemented"),
"expected #561 rejection message, got: {err}"
result.is_ok(),
"crypto.subtle.encrypt must compile after #952: {result:?}"
);
}

Expand Down
Loading