Browse Source

Added examples (#3141)

* Added examples

* Ram cargo fmt

* Changed as per Lint suggested
pull/3202/head
Arka Poddar 1 year ago committed by GitHub
parent
commit
ca969d616f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      boa_interner/src/tests.rs

18
boa_interner/src/tests.rs

@ -112,3 +112,21 @@ fn check_unpaired_surrogates() {
assert_eq!(interner.resolve_expect(sym6).utf8(), Some("jkl")); assert_eq!(interner.resolve_expect(sym6).utf8(), Some("jkl"));
assert_eq!(interner.resolve_expect(sym6).utf16(), utf16!("jkl")); assert_eq!(interner.resolve_expect(sym6).utf16(), utf16!("jkl"));
} }
#[test]
fn check_empty_interner() {
let interner = Interner::default();
let sym = sym_from_usize(123); // Choose an arbitrary symbol
assert!(interner.resolve(sym).is_none());
}
#[test]
fn check_capacity() {
let interner = Interner::with_capacity(100);
let sym = sym_from_usize(123); // Choose an arbitrary symbol
assert!(interner.resolve(sym).is_none());
}

Loading…
Cancel
Save