# What tests exist for the xml library?

**URL:** https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798
**Category:** Questions & Answers
**Tags:** xml
**Created:** [June 20, 2025, 6:07pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798 "2025-06-20T18:07:17Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![stevebyan](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@stevebyan](https://racket.discourse.group/u/stevebyan)
#### Post date: [June 20, 2025, 6:07pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/1 "2025-06-20T18:07:17Z")

</div>

I'm making changes to the xml library to make `xexpr`s serializable. What tests can I run to ensure I didn't break anything?

---

<div class="post-metadata">

### Author: ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)
#### Post date: [June 20, 2025, 6:16pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/2 "2025-06-20T18:16:24Z")

</div>

They're all here: [racket/pkgs/racket-test/tests/xml at master · racket/racket · GitHub](https://github.com/racket/racket/tree/master/pkgs/racket-test/tests/xml)

---

<div class="post-metadata">

### Author: ![stevebyan](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@stevebyan](https://racket.discourse.group/u/stevebyan)
#### Post date: [June 20, 2025, 6:17pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/3 "2025-06-20T18:17:13Z")

</div>

thank you.

---

<div class="post-metadata">

### Author: ![stevebyan](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@stevebyan](https://racket.discourse.group/u/stevebyan)
#### Post date: [June 20, 2025, 7:36pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/4 "2025-06-20T19:36:53Z")

</div>

I made the changes in this commit:

> **[Comparing racket:master...stevebyan:serializable-xexprs · racket/racket](https://github.com/racket/racket/compare/master...stevebyan:racket:serializable-xexprs)**
>
> The Racket repository. Contribute to racket/racket development by creating an account on GitHub.

to `racket/collects/xml/private/core.rkt`.

This results in two test failures in the xml library tests, because the text of an exception no longer matches the expectation:

```scheme
raco test: (submod (file "/Users/smb/GitHub/racket/pkgs/racket-test/tests/xml/test.rkt") test)
raco test: @(test-responsible 'jay)
--------------------
XML > Reading and Writing XML > read-xml/element > <!-- comment --><br />
FAILURE
name: check-exn
location: pkgs/racket-test/tests/xml/test.rkt:20:2
params:
  '(#<procedure:.../tests/xml/test.rkt:22:3>
  #<procedure:.../tests/xml/test.rkt:24:3>)
message: "Wrong exception raised"
exn-message:
  "read-xml: parse-error: expected root element - received '#s(comment \" comment \")"
exn:
  #(struct:exn:xml "read-xml: parse-error: expected root element - received '#s(comment \" comment \")" #<continuation-mark-set> (#(struct:srcloc string #f #f #f #f)) ...)
--------------------
--------------------
XML > Reading and Writing XML > syntax:read-xml/element > <!-- comment --><br />
FAILURE
name: check-exn
location: pkgs/racket-test/tests/xml/test.rkt:20:2
params:
  '(#<procedure:.../tests/xml/test.rkt:22:3>
  #<procedure:.../tests/xml/test.rkt:24:3>)
message: "Wrong exception raised"
exn-message:
  "read-xml: parse-error: expected root element - received '#s(comment \" comment \")"
exn:
  #(struct:exn:xml "read-xml: parse-error: expected root element - received '#s(comment \" comment \")" #<continuation-mark-set> (#(struct:srcloc string #f #f #f #f)) ...)
--------------------
253 success(es) 2 failure(s) 0 error(s) 255 test(s) run
2
2/255 test failures

```

Is this exception text part of the API or can I simply edit the test to update it with the new exception text?

---

<div class="post-metadata">

### Author: ![stevebyan](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@stevebyan](https://racket.discourse.group/u/stevebyan)
#### Post date: [June 20, 2025, 7:56pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/5 "2025-06-20T19:56:41Z")

</div>

Is there a way to run all the tests, other than by specifying the test files individually? `raco test -l tests/xml/test` doesn't include the other tests in the `tests/xml` directory.

---

<div class="post-metadata">

### Author: ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)
#### Post date: [June 20, 2025, 8:28pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/6 "2025-06-20T20:28:18Z")

</div>

`raco test -c tests/xml` should do what you want.

---

<div class="post-metadata">

### Author: ![stevebyan](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@stevebyan](https://racket.discourse.group/u/stevebyan)
#### Post date: [June 20, 2025, 8:42pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798/7 "2025-06-20T20:42:33Z")

</div>

Thanks, that did it. They all pass, provided that I amend the exception text in `test.rkt`.
