mirror of
https://github.com/fluffos/fluffos
synced 2026-08-12 18:26:06 -04:00
Source resolution is now explicit-extension-exact: load_object("/foo.c")
probes only foo.c, never foo.lpc (and vice versa); extension-less names
prefer .lpc and fall back to .c. Object identity stays extension-blind:
object names carry no extension, any spelling finds a loaded object, and
the registry is consulted before the filesystem. The caller's raw
spelling now flows through find_object()/inherit/master/simul_efun loads
instead of being pre-stripped away.
- filename_to_obname and otable basename() strip .lpc too (children())
- save_object() strips either source extension before appending .o
- replace_program()/function_exists() handle both suffixes
- testsuite: all LPC sources renamed to .lpc; runner globs, master
get_include_path cases, and program-name assertions updated;
README.md rewritten with the extension rules and suite conventions
- new single/tests/efuns/dual_extension.lpc pins exact-pick, fallback,
no-crossover, identity, and registry-before-filesystem with .c/.lpc
fixture pairs in /clone
Verified: ctest 297/297 and driver-autotest x3 (ASan Debug) plus
RelWithDebInfo ctest + autotest.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
28 lines
1 KiB
Text
28 lines
1 KiB
Text
// Test NUMBER_STRING sefun
|
|
|
|
void do_tests()
|
|
{
|
|
|
|
ASSERT_EQ( number_string( 0 ), "0" ) ;
|
|
ASSERT_EQ( number_string( 100 ), "100" ) ;
|
|
ASSERT_EQ( number_string( 1000 ), "1000" ) ;
|
|
ASSERT_EQ( number_string( 123456789 ), "123456789" ) ;
|
|
|
|
ASSERT_EQ( number_string( 0.0 ), "0.000000" ) ;
|
|
ASSERT_EQ( number_string( 0.5 ), "0.500000" ) ;
|
|
ASSERT_EQ( number_string( 100.5 ), "100.500000" ) ;
|
|
ASSERT_EQ( number_string( 1000.6 ), "1000.600000" ) ;
|
|
ASSERT_EQ( number_string( 123456789.123456 ), "123456789.123456" ) ;
|
|
|
|
ASSERT_EQ( number_string( 0, 1 ), "0" ) ;
|
|
ASSERT_EQ( number_string( 100, 1 ), "100" ) ;
|
|
ASSERT_EQ( number_string( 1000, 1 ), "1,000" ) ;
|
|
ASSERT_EQ( number_string( 123456789, 1 ), "123,456,789" ) ;
|
|
|
|
ASSERT_EQ( number_string( 0.0, 1 ), "0.000000" ) ;
|
|
ASSERT_EQ( number_string( 0.5, 1 ), "0.500000" ) ;
|
|
ASSERT_EQ( number_string( 100.5, 1 ), "100.500000" ) ;
|
|
ASSERT_EQ( number_string( 1000.6, 1 ), "1,000.600000" ) ;
|
|
ASSERT_EQ( number_string( 123456789.123456, 1 ), "123,456,789.123456" ) ;
|
|
|
|
}
|