Documentation
¶
Overview ¶
Package officesavetest holds what a real ONLYOFFICE Document Server saved, byte for byte, for the tests of the packages that keep a saved CSV in its file's way (officesave, onlyoffice). Docs 9.4.0-129 (onlyoffice/documentserver, JWT on, its defaults), 2026-10-05: the CSV is opened as filex opens one (UTF-8 and its own delimiter in document.options), the editor in the language filex passes, cells are typed through the cell name box and the editor is closed; the bytes are the file of the status 2 callback, taken by a harness outside filex.
⚠ They are the ground truth csvSame's rules answer to (officesave csv_keep.go). A rule they contradict is a wrong rule, and a false "same" undoes a person's edit.
Index ¶
Constants ¶
const Docs94CommaOriginal = "Ad;Telefon;Kod;Tarih;Tutar;Hesap\r\n" +
"Ayşe Yılmaz;05320000001;007;01.02.2026;3,5;TR000000000000000000000001\r\n" +
"Mehmet Demir;05330000002;042;15.03.2026;1250,75;TR000000000000000000000002\r\n" +
"Can Kaya;05340000003;000;28.02.2026;0,25;TR000000000000000000000003\r\n"
Docs94CommaOriginal is the file of the report (a production install, filex 0.56.3 with Docs 9.4.0-129, the editor in Turkish): invented data, semicolons, CRLF, no byte order mark. E2 `3,5` typed over as `4,5`, nothing else touched; filex 0.56.3 wrote `4.5`.
const Docs94Fixture = "ad;adet;not;kod;tel;tarih\r\n" +
"elma;3;\"a; b\";007;05320000001;01.02.2026\r\n" +
"armut;5;şeker;042;05330000002;15.03.2026\r\n"
Docs94Fixture is the fixture of the release gate (e2e/tests/199-csv-onlyoffice.spec.ts, GitHub #88): semicolons, CRLF, no byte order mark.
Variables ¶
var Docs94CommaSaved = map[string]Saved{ "tr": { Saved: "\xEF\xBB\xBFAd,Telefon,Kod,Tarih,Tutar,Hesap\n" + "Ayşe Yılmaz,5320000001,7,1.02.2026,4.5,TR000000000000000000000001\n" + "Mehmet Demir,5330000002,42,15.03.2026,\"1250,75\",TR000000000000000000000002\n" + "Can Kaya,5340000003,0,28.02.2026,\"0,25\",TR000000000000000000000003\n", Want: docs94CommaEdited, }, "de": { Saved: "\xEF\xBB\xBFAd,Telefon,Kod,Tarih,Tutar,Hesap\n" + "Ayşe Yılmaz,5320000001,7,01.02.2026,4.5,TR000000000000000000000001\n" + "Mehmet Demir,5330000002,42,15.03.2026,\"1250,75\",TR000000000000000000000002\n" + "Can Kaya,5340000003,0,28.02.2026,\"0,25\",TR000000000000000000000003\n", Want: docs94CommaEdited, }, "en": { Saved: "\xEF\xBB\xBFAd,Telefon,Kod,Tarih,Tutar,Hesap\n" + "Ayşe Yılmaz,5320000001,7,1/2/2026,\"4,5\",TR000000000000000000000001\n" + "Mehmet Demir,5330000002,42,15.03.2026,\"1250,75\",TR000000000000000000000002\n" + "Can Kaya,5340000003,0,28.02.2026,\"0,25\",TR000000000000000000000003\n", Want: docs94CommaEdited, }, "tr, a row added": { Saved: "\xEF\xBB\xBFAd,Telefon,Kod,Tarih,Tutar,Hesap\n" + "Ayşe Yılmaz,5320000001,7,1.02.2026,\"3,5\",TR000000000000000000000001\n" + "Mehmet Demir,5330000002,42,15.03.2026,\"1250,75\",TR000000000000000000000002\n" + "Can Kaya,5340000003,0,28.02.2026,1.1000000000000001,TR000000000000000000000003\n" + "Zeynep Ak,5350000004,9,,2.75\n", Want: strings.Replace(Docs94CommaOriginal, ";0,25;", ";1,1;", 1) + "Zeynep Ak;5350000004;9;;2,75\r\n", }, }
Docs94CommaSaved is what each editor saved for it, and what the file gets.
var Docs94FixtureEdited = strings.Replace(Docs94Fixture, "elma;3;", "elma;42;", 1)
Docs94FixtureEdited is the fixture with `3` in B2 typed over as `42`, nothing else touched.
var Docs94FixtureSaved = map[string]Saved{ "en": { Saved: "\xEF\xBB\xBFad,adet,not,kod,tel,tarih\n" + "elma,42,a; b,7,5320000001,1/2/2026\n" + "armut,5,şeker,42,5330000002,15.03.2026\n", Want: Docs94FixtureEdited, }, "tr": { Saved: "\xEF\xBB\xBFad,adet,not,kod,tel,tarih\n" + "elma,42,a; b,7,5320000001,1.02.2026\n" + "armut,5,şeker,42,5330000002,15.03.2026\n", Want: Docs94FixtureEdited, }, "de": { Saved: "\xEF\xBB\xBFad,adet,not,kod,tel,tarih\n" + "elma,42,a; b,7,5320000001,01.02.2026\n" + "armut,5,şeker,42,5330000002,15.03.2026\n", Want: Docs94FixtureEdited, }, "fr": { Saved: "\xEF\xBB\xBFad,adet,not,kod,tel,tarih\n" + "elma,42,a; b,7,5320000001,01/02/2026\n" + "armut,5,şeker,42,5330000002,15/03/2026\n", Want: strings.NewReplacer("01.02.2026", "01/02/2026", "15.03.2026", "15/03/2026").Replace(Docs94FixtureEdited), }, }
Docs94FixtureSaved is what ONLYOFFICE saved for the fixture, by the editor's language, and what the file gets. In every one the leading zeros are gone; the dates are written the language's way (German writes these two as they were).
Functions ¶
This section is empty.