File: blank_test.rb

package info (click to toggle)
rust-magnus 0.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,468 kB
  • sloc: ruby: 150; sh: 17; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 460 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
# frozen_string_literal: true

require "test/unit"
require_relative "../lib/rust_blank"

class BlankTest < Test::Unit::TestCase

  def test_blank?
    assert { "".blank? }
    assert { "   ".blank? }
    assert { "  \n\t  \r ".blank? }
    assert { " ".blank? }
    assert { "\u00a0".blank? }
    assert { " ".encode("UTF-16LE").blank? }
  end

  def test_not_blank?
    assert { !"a".blank? }
    assert { !"my value".encode("UTF-16LE").blank? }
  end

end