@@ -0,0 +1,38 @@
1+/*
2+ * Copyright 2013 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import "../../../Components/IconUtil.js" as IconUtil
20+
21+TestCase {
22+ id: root
23+ name: "IconUtil"
24+
25+ function test_from_gicon_data() {
26+ return [ {in: ". GThemedIcon one", out: "image://theme/one"},
27+ {in: ". GThemedIcon one two", out: "image://theme/one,two"},
28+ {in: ". UnityProtocolAnnotatedIcon %7B'base-icon':%20%3C'.%20GThemedIcon%20one%20two'%3E%7D", out: "image://theme/one,two"},
29+ {in: "icon.test_0-name", out: "image://theme/icon.test_0-name"},
30+ {in: "?^713]p", out: "?^713]p"},
31+ ]
32+ }
33+
34+ function test_from_gicon(data) {
35+ var out = IconUtil.from_gicon(data.in)
36+ compare(out, data.out)
37+ }
38+}