Tests: the host name check lists the AutoCAD export names

The host adds ExportOptionsAutoCAD, the six AutoCAD enumerations and
ExportType.AUTOCAD, and every_name_the_host_adds_has_a_row now finds a
row for each. The AutoCAD export test checks that the DXF origin is
within 1 mm of the art's left edge on either side of zero.
This commit is contained in:
dotCooCoo committed 2026-11-25 21:40:42 -08:00
1 parent ca877835e9
commit d2ae34dfca
2 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -225,7 +225,7 @@ fn an_autocad_export_writes_a_dxf_with_its_options() {
let dxf = std::fs::read_to_string(dir.join(name)).unwrap();
assert_eq!(dxf_header(&dxf, "$ACADVER").as_deref(), Some("AC1024"), "{name}: an option left out or undefined is AutoCADRelease24");
// The rectangle is 10 pt (3.5 mm) from the artboard's left edge.
assert!(dxf_leftmost(&dxf) < 1.0, "{name}: the origin is at the visible art's bounds: {}", dxf_leftmost(&dxf));
assert!(dxf_leftmost(&dxf).abs() < 1.0, "{name}: the origin is at the visible art's bounds: {}", dxf_leftmost(&dxf));
}
let p = std::fs::read_to_string(dir.join("p.dxf")).unwrap();
assert!(dxf_widest(&p) > dxf_widest(&b) * 5.0, "a pica is a sixth of an inch: {} and {}", dxf_widest(&p), dxf_widest(&b));
@@ -142,6 +142,13 @@ const INSIDE: &[(&str, &str)] = &[
"Compatibility EPSPostScriptLevelEnum EPSPreview ExportType PDFBoxType PDFCompatibility PDFOverprint SaveOptions \
UserInteractionLevel",
),
("", "AutoCADColors AutoCADCompatibility AutoCADExportFileFormat AutoCADExportOption AutoCADRasterFormat AutoCADUnit"),
("AutoCADColors.", "Max16Colors Max256Colors Max8Colors TrueColors"),
("AutoCADCompatibility.", "AutoCADRelease13 AutoCADRelease14 AutoCADRelease15 AutoCADRelease18 AutoCADRelease21 AutoCADRelease24"),
("AutoCADExportFileFormat.", "DWG DXF"),
("AutoCADExportOption.", "MaximizeEditability PreserveAppearance"),
("AutoCADRasterFormat.", "JPEG PNG"),
("AutoCADUnit.", "Centimeters Inches Millimeters Picas Pixels Points"),
(
"Compatibility.",
"ILLUSTRATOR10 ILLUSTRATOR11 ILLUSTRATOR12 ILLUSTRATOR13 ILLUSTRATOR14 ILLUSTRATOR15 ILLUSTRATOR16 ILLUSTRATOR17 \
@@ -149,7 +156,7 @@ const INSIDE: &[(&str, &str)] = &[
),
("EPSPostScriptLevelEnum.", "LEVEL2 LEVEL3"),
("EPSPreview.", "BWTIFF COLORTIFF None TRANSPARENTCOLORTIFF"),
("ExportType.", "AutoCAD FLASH GIF JPEG PNG24 PNG8 SVG TIFF"),
("ExportType.", "AUTOCAD AutoCAD FLASH GIF JPEG PNG24 PNG8 SVG TIFF"),
("PDFBoxType.", "PDFARTBOX PDFBLEEDBOX PDFBOUNDINGBOX PDFCROPBOX PDFMEDIABOX PDFTRIMBOX"),
("PDFCompatibility.", "ACROBAT4 ACROBAT5 ACROBAT6 ACROBAT7 ACROBAT8"),
("PDFOverprint.", "DISCARDPDFOVERPRINT PRESERVEPDFOVERPRINT"),
@@ -160,8 +167,8 @@ const INSIDE: &[(&str, &str)] = &[
/// The classes the host adds with nothing but a prototype and its constructor: the page item types
/// and the save and export option classes.
const BARE_CLASSES: &str = "BlendItem CompoundPathItem EnvelopeItem GraphItem GroupItem IntertwineItem MeshItem PathItem \
PlacedDocumentItem PlacedItem RasterItem RepeatItem SymbolItem TextFrame EPSSaveOptions ExportOptionsJPEG ExportOptionsPNG24 \
ExportOptionsSVG IllustratorSaveOptions PDFSaveOptions";
PlacedDocumentItem PlacedItem RasterItem RepeatItem SymbolItem TextFrame EPSSaveOptions ExportOptionsAutoCAD ExportOptionsJPEG \
ExportOptionsPNG24 ExportOptionsSVG IllustratorSaveOptions PDFSaveOptions";
/// The name the checker does not read, which also stands for its members: `vc` is VectorCraft's
/// own API, and what `vc.run` does depends on the command it runs.