alle new
This commit is contained in:
erik committed 2026-10-01 06:46:51 +02:00
1 parent da64472251
commit 5b20adee48
1605 files changed
+396517 -1674

No files matched your search

Generated Vendored Executable
+36
View File
@@ -0,0 +1,36 @@
var errors = require("../lib/errors");
var StringSource = require("../lib/StringSource");
exports.errorDescriptionIncludesLocationAndActualValueAndExpectedValue = function(test) {
var error = errors.error({
expected: "Nothing",
actual: "Something",
location: {
describe: function() {
return "Here"
}
}
});
test.equal("Here:\nExpected Nothing\nbut got Something", error.describe());
test.done();
};
exports.canDescribeErrorWithoutLocation = function(test) {
var error = errors.error({
expected: "Nothing",
actual: "Something"
});
test.equal("Expected Nothing\nbut got Something", error.describe());
test.done();
};
exports.canGetPositionFromError = function(test) {
var error = errors.error({
expected: "Nothing",
actual: "Something",
location: new StringSource("abc\ndef\nghi\n", "").range(6, 8)
});
test.equal(2, error.lineNumber());
test.equal(3, error.characterNumber());
test.done();
};