Skip to content

Commit

Permalink
[chore] Additional bytecode tests (MystenLabs#17904)
Browse files Browse the repository at this point in the history
## Description 

- Added missing parser test for unicode byte strings 

## Test plan 

- tests 

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
tnowacki authored May 23, 2024
1 parent 2dc5a07 commit 69aa645
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
processed 1 task
processed 2 tasks
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
//# init --edition 2024.beta

//# run
module 0x42::m {

fun main() {
assert!(b"" == x"", 0);
assert!(b"Diem" == x"4469656D", 1);
assert!(b"\x4c\x69\x62\x72\x61" == x"4c69627261", 2);
assert!(b"" == x"");
assert!(b"Diem" == x"4469656D");
assert!(b"\x4c\x69\x62\x72\x61" == x"4c69627261");
assert!(
b"Γ λ x. x : ∀α. α α" ==
x"CE9320E28AA220CEBB20782E2078203A20E28880CEB12E20CEB120E2869220CEB1",
3
);
assert!(
b"😏\n👉🕶️\n😎" ==
vector[
240,
159,
152,
143,
10,
240,
159,
145,
137,
240,
159,
149,
182,
239,
184,
143,
10,
240,
159,
152,
142,
],
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ module 0x8675309::M {
public fun escaped_backslash_before_quote(): vector<u8> {
b"\\"
}
public fun utf8(): vector<u8> {
b"😏👉🕶️😎"
}
}

0 comments on commit 69aa645

Please sign in to comment.