File: test_encoding.rb

package info (click to toggle)
ruby-dalli 3.2.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: ruby: 6,552; sh: 20; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 642 bytes parent folder | download
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
# frozen_string_literal: true

require_relative '../helper'

describe 'Encoding' do
  MemcachedManager.supported_protocols.each do |p|
    describe "using the #{p} protocol" do
      it 'supports Unicode values' do
        memcached_persistent(p) do |dc|
          key = 'foo'
          utf8 = 'ƒ©åÍÎ'

          assert dc.set(key, utf8)
          assert_equal utf8, dc.get(key)
        end
      end

      it 'supports Unicode keys' do
        memcached_persistent(p) do |dc|
          utf_key = utf8 = 'ƒ©åÍÎ'

          dc.set(utf_key, utf8)

          assert_equal utf8, dc.get(utf_key)
        end
      end
    end
  end
end