auto_test.go 719 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2014 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. package auto_test
  7. import (
  8. "bytes"
  9. "compress/gzip"
  10. "io/ioutil"
  11. "testing"
  12. "github.com/syncthing/syncthing/lib/auto"
  13. )
  14. func TestAssets(t *testing.T) {
  15. assets := auto.Assets()
  16. idx, ok := assets["default/index.html"]
  17. if !ok {
  18. t.Fatal("No index.html in compiled in assets")
  19. }
  20. var gr *gzip.Reader
  21. gr, _ = gzip.NewReader(bytes.NewReader(idx))
  22. idx, _ = ioutil.ReadAll(gr)
  23. if !bytes.Contains(idx, []byte("<html")) {
  24. t.Fatal("No html in index.html")
  25. }
  26. }