Sha256: 1e94118da7c2f15136a4e67bf06eaef18cc765f574ef9fb9b3ad093607b5b231

Contents?: true

Size: 825 Bytes

Versions: 315

Compression:

Stored size: 825 Bytes

Contents

require_relative '../helper'
require 'fluent/plugin/string_util'

class StringUtilTest < Test::Unit::TestCase
  def setup
    @null_value_pattern = Regexp.new("^(-|null|NULL)$")
  end

  sub_test_case 'valid string' do
    test 'null string' do
      assert_equal Fluent::StringUtil.match_regexp(@null_value_pattern, "null").to_s, "null"
      assert_equal Fluent::StringUtil.match_regexp(@null_value_pattern, "NULL").to_s, "NULL"
      assert_equal Fluent::StringUtil.match_regexp(@null_value_pattern, "-").to_s, "-"
    end

    test 'normal string' do
      assert_equal Fluent::StringUtil.match_regexp(@null_value_pattern, "fluentd"), nil
    end
  end

  sub_test_case 'invalid string' do
    test 'normal string' do
      assert_equal Fluent::StringUtil.match_regexp(@null_value_pattern, "\xff"), nil
    end
  end
end

Version data entries

315 entries across 315 versions & 9 rubygems

Version Path
fluentd-1.16.4-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.16.4-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.4-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.4 test/plugin/test_string_util.rb
fluentd222-1.16.2-x86_64-linux test/plugin/test_string_util.rb
fluentd-1.16.3-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.3-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.3-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.16.3 test/plugin/test_string_util.rb
fluentd-1.16.2-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.2-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.2-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.16.2 test/plugin/test_string_util.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/fluentd-1.16.1/test/plugin/test_string_util.rb
fluentd-1.16.1-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.16.1-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.1-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.1 test/plugin/test_string_util.rb
fluentd-1.16.0-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.0-x64-mingw-ucrt test/plugin/test_string_util.rb