oficina / slides Public

Keep selected framework theme drift guard with shared bytes

claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 2c5ac01020d2de92f46555e2f7d7884099029616 parent 9b5ae51
1 file changed, +18 −1
  • internal/slidestest/vendored_test.go +18 −1

CI passed — run details

diff --git a/internal/slidestest/vendored_test.go b/internal/slidestest/vendored_test.go
index d08acbd..1aeb99f 100644
--- a/internal/slidestest/vendored_test.go
+++ b/internal/slidestest/vendored_test.go
@@ -6,6 +6,7 @@ import (
"path/filepath"
"testing"
+ "amadan.net/oficina/estilo.git/theme"
"amadan.net/rastrillo/rastrillo/ui"
)
@@ -42,7 +43,14 @@ func TestVendoredAssetsMatchTheLibrary(t *testing.T) {
if vendoredIsMine[name] {
continue
}
- vendored, err := os.ReadFile(filepath.Join("..", "slides", "static", name))
+ var vendored []byte
+ var err error
+ if name == "theme.css" {
+ vendored = themeBody(theme.CSS())
+ lib = themeBody(lib)
+ } else {
+ vendored, err = os.ReadFile(filepath.Join("..", "slides", "static", name))
+ }
if err != nil {
t.Errorf("read vendored %s: %v", name, err)
continue
@@ -52,3 +60,12 @@ func TestVendoredAssetsMatchTheLibrary(t *testing.T) {
}
}
}
+
+func themeBody(css []byte) []byte {
+ if bytes.HasPrefix(css, []byte("/*")) {
+ if end := bytes.Index(css, []byte("*/")); end >= 0 {
+ return css[end+2:]
+ }
+ }
+ return css
+}