ResourcePackTests.st
changeset 2574 02c1bb012f30
child 2579 bec2c103be07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ResourcePackTests.st	Tue Feb 25 17:17:25 2020 +0100
@@ -0,0 +1,40 @@
+"{ Package: 'stx:goodies/regression' }"
+
+"{ NameSpace: Smalltalk }"
+
+TestCase subclass:#ResourcePackTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'tests-Regression-UI'
+!
+
+
+!ResourcePackTests methodsFor:'tests'!
+
+test01_lineParsing
+    |p|
+
+    p := ResourcePack new.
+    ResourcePack processResourceLine:'''foo1'' ''xlation_of_foo1''' encoding:nil file:'dummy.rc' printErrorWith:[:err | Logger warn:err] for:p keepUselessTranslations:false.
+    self assert:(p at:'foo1') = 'xlation_of_foo1'.
+
+    "/ c-strings?
+    ResourcePack processResourceLine:'c''foo2\tfoo'' ''xlation_of_foo2''' encoding:nil file:'dummy.rc' printErrorWith:[:err | Logger warn:err] for:p keepUselessTranslations:false.
+    ResourcePack processResourceLine:'c''foo3\tfoo'' c''xlation_\t_foo3''' encoding:nil file:'dummy.rc' printErrorWith:[:err | Logger warn:err] for:p keepUselessTranslations:false.
+    self assert:(p at:c'foo2\tfoo') = 'xlation_of_foo2'.
+    self assert:(p at:c'foo3\tfoo') = c'xlation_\t_foo3'.
+
+
+    "
+     self run:#test01_lineParsing
+     self new test01_lineParsing
+    "
+! !
+
+!ResourcePackTests class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header$'
+! !
+