diff options
Diffstat (limited to 'src/ext_depends/D-YAML/source/dyaml/loader.d')
-rw-r--r-- | src/ext_depends/D-YAML/source/dyaml/loader.d | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ext_depends/D-YAML/source/dyaml/loader.d b/src/ext_depends/D-YAML/source/dyaml/loader.d index 7e7096c..09c19db 100644 --- a/src/ext_depends/D-YAML/source/dyaml/loader.d +++ b/src/ext_depends/D-YAML/source/dyaml/loader.d @@ -165,6 +165,7 @@ struct Loader void name(string name) pure @safe nothrow @nogc { name_ = name; + scanner_.name = name; } /// Specify custom Resolver to use. @@ -392,3 +393,19 @@ struct Loader auto doc = Loader.fromString(yaml).load(); assert(doc.isValid); } + +@safe unittest +{ + import std.exception : collectException; + + auto yaml = q"EOS + value: invalid: string +EOS"; + auto filename = "invalid.yml"; + auto loader = Loader.fromString(yaml); + loader.name = filename; + + Node unused; + auto e = loader.load().collectException!ScannerException(unused); + assert(e.mark.name == filename); +} |