Dollar signs followed by a number in the values of replacement arguments passed to DrupalWebTestCase::buildXPathQuery() seem to be handled as a regular expression back reference, causing certain values to be changed inappropriately.
$query = $this->buildXPathQuery(':test', array(':test' => '$1bc'));
I expected $query to have the value: "$1bc"
Actual value however is: "bc"
Use case: we use DrupalWebTestCase::randomString() quite often to generate node titles. DrupalWebTestCase::randomString() might generate something that is recognized as a back reference.