1. Kink Programming Language
  2. Untitled project
  3. kink

Commits

Taku Miyakawa  committed f353609

Renames COMMON_PATTERN.identical to .identical_to (closing issue #487)

  • Participants
  • Parent commits 88029bb
  • Branches default

Comments (0)

Files changed (7)

File src/main/kink/COMMON_PATTERN.kn

View file
  • Ignore whitespace
 }
 
 ## Pattern that the argument is identical to the expected value
-:identical = { (:Expected)
+:identical_to = { (:Expected)
     value(
         'op_match' { (:Arg) Arg.identity == Expected.identity }
-        'show' { () expand('identical(#{Expected.show})') }
+        'show' { () expand('identical_to(#{Expected.show})') }
     )
 }
 

File src/test/kink/COMMON_PATTERN_test.kn

View file
  • Ignore whitespace
 use('COMMON_PATTERN.ge')
 use('COMMON_PATTERN.instance_of')
 use('COMMON_PATTERN.same_object_as')
-use('COMMON_PATTERN.identical')
+use('COMMON_PATTERN.identical_to')
 use('COMMON_PATTERN.sub_of')
 use('TEST.test')
 
     instance_of(String).show.check("instance_of(class('java.lang.String'))")
 }
 
-# Test identical pattern
+# Test identical_to pattern
 test {
     :Twift = 'twift'
-    Twift.check(identical(Twift))
-    Twift.check(not(identical(Twift.child)))
-    Twift.check(not(identical('voxxx')))
+    Twift.check(identical_to(Twift))
+    Twift.check(not(identical_to(Twift.child)))
+    Twift.check(not(identical_to('voxxx')))
 }
 
 test {
-    identical('twift').show.check("identical('twift')")
+    identical_to('twift').show.check("identical_to('twift')")
 }
 
 # Test sub_of pattern

File src/test/kink/MAP_test.kn

View file
  • Ignore whitespace
 use('COMMON_PATTERN.not')
 use('COMMON_PATTERN.eq')
 use('COMMON_PATTERN.ne')
-use('COMMON_PATTERN.identical')
+use('COMMON_PATTERN.identical_to')
 use('JAVA.null')
 
 test {
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
-    Map.set('baz' 0xba2).check(identical(Map))
+    Map.set('baz' 0xba2).check(identical_to(Map))
     Map.get('baz').check(0xba2)
 }
 
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
-    Map.set_if_absent('baz' 0xba2).check(identical(Map))
+    Map.set_if_absent('baz' 0xba2).check(identical_to(Map))
     Map.get('baz').check(0xba2)
-    Map.set_if_absent('baz' null).check(identical(Map))
+    Map.set_if_absent('baz' null).check(identical_to(Map))
     Map.get('baz').check(0xba2)
 }
 
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
-    Map.set_if_present('foo' 0xf000).check(identical(Map))
+    Map.set_if_present('foo' 0xf000).check(identical_to(Map))
     Map.get('foo').check(0xf000)
-    Map.set_if_present('baz' 0xba2).check(identical(Map))
+    Map.set_if_present('baz' 0xba2).check(identical_to(Map))
     Map.has_key?('baz').check(false)
 }
 
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
-    Map.set_if_equal('bar' 0xbaa 0x999).check(identical(Map))
+    Map.set_if_equal('bar' 0xbaa 0x999).check(identical_to(Map))
     Map.get('bar').check(0x999)
 }
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
-    Map.set_if_equal('bar' 0x999 0x888).check(identical(Map))
+    Map.set_if_equal('bar' 0x999 0x888).check(identical_to(Map))
     Map.get('bar').check(0xbaa)
 }
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
     :Another = map('bar' 0xbaaa  'baz' 0xba2)
-    Map.append(Another).check(identical(Map))
+    Map.append(Another).check(identical_to(Map))
     Map.get('foo').check(0xf00)
     Map.get('bar').check(0xbaaa)
     Map.get('baz').check(0xba2)
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
     :Another = map('bar' 0xbaaa  'baz' 0xba2)
-    Map.append(Another) { \0 + (\1 - \2).show } .check(identical(Map))
+    Map.append(Another) { \0 + (\1 - \2).show } .check(identical_to(Map))
     Map.get('foo').check(0xf00)
     Map.get('bar').check('bar' + (0xbaa - 0xbaaa).show)
     Map.get('baz').check(0xba2)
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
-    Map.clear.check(identical(Map))
+    Map.clear.check(identical_to(Map))
     Map.any?.check(false)
 }
 
 test {
     :Map = map('foo' 0xf00  'bar' 0xbaa)
     :Clone = Map.clone
-    Clone.check(not(identical(Map)))
+    Clone.check(not(identical_to(Map)))
     Clone.get('foo').check(0xf00)
     Clone.get('bar').check(0xbaa)
 }

File src/test/kink/SET_test.kn

View file
  • Ignore whitespace
 use('COMMON_PATTERN.ne')
 use('COMMON_PATTERN.or')
 use('COMMON_PATTERN.not')
-use('COMMON_PATTERN.identical')
+use('COMMON_PATTERN.identical_to')
 
 # Tests Set.count, Set.any? and Set.empty?
 test {
     :Set = set('twift' 'voxxx')
     :Clone = Set.clone
     Clone.check(eq(Set))
-    Clone.check(not(identical(Set)))
+    Clone.check(not(identical_to(Set)))
 }
 
 # Tests Set + ANOTHER_SET

File src/test/kink/issue/issue_0131_test.kn

View file
  • Ignore whitespace
 
 use('TEST.test')
 use('COMMON_PATTERN.not')
-use('COMMON_PATTERN.identical')
+use('COMMON_PATTERN.identical_to')
 
 test {
-    42.$op_add.parent.check(not(identical({}.parent)))
+    42.$op_add.parent.check(not(identical_to({}.parent)))
 }

File src/test/kink/issue/issue_0141_test.kn

View file
  • Ignore whitespace
 # THE SOFTWARE.
 
 use('TEST.test')
-use('COMMON_PATTERN.identical')
+use('COMMON_PATTERN.identical_to')
 
 test {
     use('META.meta')
     :Twift = 'twift'
-    meta(Twift).unmeta.check(identical(Twift))
+    meta(Twift).unmeta.check(identical_to(Twift))
 }

File src/test/kink/issue/issue_0153_test.kn

View file
  • Ignore whitespace
 use('COMMON_PATTERN.ge')
 use('COMMON_PATTERN.instance_of')
 use('COMMON_PATTERN.same_object_as')
-use('COMMON_PATTERN.identical')
+use('COMMON_PATTERN.identical_to')
 use('COMMON_PATTERN.sub_of')
 
 test {
     Twift.check(same_object_as(Twift.child))
     Twift.check(not(same_object_as('voxxx')))
 
-    Twift.check(identical(Twift))
-    Twift.check(not(identical(Twift.child)))
-    Twift.check(not(identical('voxxx')))
+    Twift.check(identical_to(Twift))
+    Twift.check(not(identical_to(Twift.child)))
+    Twift.check(not(identical_to('voxxx')))
 
     Twift.check(sub_of(Twift))
     Twift.child.check(sub_of(Twift))