From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- js/src/gdb/tests/test-JSString.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 js/src/gdb/tests/test-JSString.py (limited to 'js/src/gdb/tests/test-JSString.py') diff --git a/js/src/gdb/tests/test-JSString.py b/js/src/gdb/tests/test-JSString.py new file mode 100644 index 0000000000..99cebc4ab5 --- /dev/null +++ b/js/src/gdb/tests/test-JSString.py @@ -0,0 +1,24 @@ +# Printing JSStrings. +# flake8: noqa: F821 + +assert_subprinter_registered("SpiderMonkey", "ptr-to-JSString") +run_fragment("JSString.simple") + +assert_pretty("empty", '""') +assert_pretty("x", '"x"') +assert_pretty("z", '"z"') +assert_pretty("xz", '"xz"') + +stars = gdb.parse_and_eval("stars") +assert_eq(str(stars), "'*' ") + +doubleStars = gdb.parse_and_eval("doubleStars") +assert_eq(str(doubleStars), "'*' ") + +assert_pretty("xRaw", '"x"') + +# JSAtom * + +run_fragment("JSString.atom") + +assert_pretty("molybdenum", '"molybdenum"') -- cgit v1.2.3