Sha256: 1e94118da7c2f15136a4e67bf06eaef18cc765f574ef9fb9b3ad093607b5b231

Contents?: true

Size: 825 Bytes

Versions: 311

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

311 entries across 311 versions & 9 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin/test_string_util.rb
fluentd-1.16.6-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.6-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.6-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.16.6 test/plugin/test_string_util.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin/test_string_util.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin/test_string_util.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin/test_string_util.rb
fluentd-1.17.0-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.17.0-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.17.0-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.17.0 test/plugin/test_string_util.rb
fluentd-1.16.5-x64-mingw-ucrt test/plugin/test_string_util.rb
fluentd-1.16.5-x86-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.5-x64-mingw32 test/plugin/test_string_util.rb
fluentd-1.16.5 test/plugin/test_string_util.rb
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