From: Nick Porter Date: Tue, 5 Aug 2025 11:30:19 +0000 (+0100) Subject: Add test using float value in mRuby X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=efc4379cfcf604a18ff0c3749d68137c92324341;p=thirdparty%2Ffreeradius-server.git Add test using float value in mRuby --- diff --git a/src/tests/modules/mruby/attrs.unlang b/src/tests/modules/mruby/attrs.unlang index 191eac2db4..a916526dd3 100644 --- a/src/tests/modules/mruby/attrs.unlang +++ b/src/tests/modules/mruby/attrs.unlang @@ -24,6 +24,14 @@ if (User-Name != 'john') { test_fail } +mruby.set_float +if (!ok) { + test_fail +} +if (NAS-Port != 12) { + test_fail +} + mruby.set_nested if (!updated) { test_fail diff --git a/src/tests/modules/mruby/test.rb b/src/tests/modules/mruby/test.rb index 49af52fb75..c89cf7ade2 100644 --- a/src/tests/modules/mruby/test.rb +++ b/src/tests/modules/mruby/test.rb @@ -31,6 +31,12 @@ module FreeRADIUS return RLM_MODULE_OK end + # Check casting from a float + def self.set_float(p) + p.request.nas_port.set(12.0) + return RLM_MODULE_OK + end + # Check setting nested pairs def self.set_nested(p) p.control.vendor_specific.cisco.avpair.set('very=special')