File: unicode_test.go

package info (click to toggle)
golang-github-wellington-go-libsass 0.9.2%2Bgit20181130.4ef5b9d-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,128 kB
  • sloc: cpp: 28,607; ansic: 839; makefile: 44
file content (49 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package libsass

import (
	"bytes"
	"fmt"
	"strings"
	"testing"
)

func TestUnicode(t *testing.T) {
	t.Skip("unicode can not be stored in variables")
	var dst bytes.Buffer

	src := bytes.NewBufferString(`
$test: "\f00d";

p {
	a {
		content: $test;
	}

	b {
		content: "\f00c";
	}
}
`)

	comp, err := New(&dst, src)
	if err != nil {
		t.Error("Expected to create compiler successfully")
	}

	err = comp.Run()
	if err != nil {
		t.Error("Expected to run the compiler successfully")
	}

	css := dst.String()

	if !strings.Contains(css, "\\f00c") { // This one is passing
		t.Errorf("Expected to find `%s` in compiled css", "\\f00c")
	}

	if !strings.Contains(css, "\\f00d") { // This one isn't
		t.Errorf("Expected to find `%s` in compiled css", "\\f00d")
	}

	fmt.Println(dst.String())
}