test(bls): literal parsing tests

This commit is contained in:
rvcas 2023-11-07 15:56:05 -05:00 committed by Lucas
parent 8b89ba3b93
commit 7073fd29b3
3 changed files with 140 additions and 0 deletions

View File

@ -63,4 +63,14 @@ mod tests {
fn bytearray_utf8_escaped() { fn bytearray_utf8_escaped() {
assert_expr!("\"\\\"aiken\\\"\""); assert_expr!("\"\\\"aiken\\\"\"");
} }
#[test]
fn g1_element() {
assert_expr!("#<Bls12_381, G1>\"950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5\"");
}
#[test]
fn g2_element() {
assert_expr!("#<Bls12_381, G2>\"b0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1\"");
}
} }

View File

@ -0,0 +1,44 @@
---
source: crates/aiken-lang/src/parser/expr/bytearray.rs
description: "Code:\n\n#<Bls12_381, G1>\"950dfd33da2682260c76038dfb8bad6e84ae9d599a3c151815945ac1e6ef6b1027cd917f3907479d20d636ce437a41f5\""
---
CurvePoint {
location: 0..114,
point: Bls12_381(
G1(
blst_p1 {
x: blst_fp {
l: [
6044239372598254900,
11111890802926526657,
302563157772145122,
17359147598889707489,
6255098506247414666,
1773881592225990778,
],
},
y: blst_fp {
l: [
9961536754182800925,
16512912018612749997,
10822258563185590636,
17742512098199848220,
16542676355910829810,
1246663995533626329,
],
},
z: blst_fp {
l: [
8505329371266088957,
17002214543764226050,
6865905132761471162,
8632934651105793861,
6631298214892334189,
1582556514881692819,
],
},
},
),
),
preferred_format: HexadecimalString,
}

View File

@ -0,0 +1,86 @@
---
source: crates/aiken-lang/src/parser/expr/bytearray.rs
description: "Code:\n\n#<Bls12_381, G2>\"b0629fa1158c2d23a10413fe91d381a84d25e31d041cd0377d25828498fd02011b35893938ced97535395e4815201e67108bcd4665e0db25d602d76fa791fab706c54abf5e1a9e44b4ac1e6badf3d2ac0328f5e30be341677c8bac5dda7682f1\""
---
CurvePoint {
location: 0..210,
point: Bls12_381(
G2(
blst_p2 {
x: blst_fp2 {
fp: [
blst_fp {
l: [
17730081354175209597,
14393386882433024580,
15392237588654399813,
13132804324748058634,
437180824693959563,
1209861931331675905,
],
},
blst_fp {
l: [
16640134302799489459,
13200372101402265278,
3491868243815184488,
15749231165976205625,
10700844509881097270,
978652262052845623,
],
},
],
},
y: blst_fp2 {
fp: [
blst_fp {
l: [
15138882304466955413,
4159460337006967255,
16059739792181277381,
4673287545394659101,
6265740687822174786,
1492317236631555918,
],
},
blst_fp {
l: [
7482650483077279660,
1528034342759119680,
1732030343867801117,
8394128533480400141,
6497663211870147931,
683724859415636652,
],
},
],
},
z: blst_fp2 {
fp: [
blst_fp {
l: [
8505329371266088957,
17002214543764226050,
6865905132761471162,
8632934651105793861,
6631298214892334189,
1582556514881692819,
],
},
blst_fp {
l: [
0,
0,
0,
0,
0,
0,
],
},
],
},
},
),
),
preferred_format: HexadecimalString,
}