mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Add test for underivable optional record
This commit is contained in:
parent
68441479b8
commit
3770db5d70
2 changed files with 21 additions and 4 deletions
|
@ -6,14 +6,14 @@
|
|||
|
||||
use crate::{
|
||||
test_key_eq, test_key_neq,
|
||||
util::{check_immediate, derive_test},
|
||||
util::{check_immediate, check_underivable, derive_test},
|
||||
v,
|
||||
};
|
||||
use insta::assert_snapshot;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_types::subs::Variable;
|
||||
|
||||
use roc_derive_key::DeriveBuiltin::Decoder;
|
||||
use roc_derive_key::{DeriveBuiltin::Decoder, DeriveError};
|
||||
|
||||
test_key_eq! {
|
||||
Decoder,
|
||||
|
@ -43,6 +43,11 @@ test_key_neq! {
|
|||
v!(EMPTY_RECORD), v!({ a: v!(U8), })
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn optional_record_field_derive_error() {
|
||||
check_underivable(Decoder, v!({ ?a: v!(U8), }), DeriveError::Underivable);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn immediates() {
|
||||
check_immediate(Decoder, v!(U8), Symbol::DECODE_U8);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue