diff options
author | Eduardo Julian | 2022-11-23 20:35:07 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-11-23 20:35:07 -0400 |
commit | 44cff1dcbd6cd23ef455923b707104302dde1aad (patch) | |
tree | 8351360a41980e01cbb8124a03264d17775553fd /stdlib/source/test/lux/world | |
parent | 224797231a8144f6ead1baab3b4b01a74cab629c (diff) |
New arithmetic abstraction + common file extensions as constants.
Diffstat (limited to 'stdlib/source/test/lux/world')
-rw-r--r-- | stdlib/source/test/lux/world/file.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/file/extension.lux | 148 |
2 files changed, 151 insertions, 1 deletions
diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index 35402d81a..d2f3cde55 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -28,7 +28,8 @@ ["[0]" unit] ["_" property (.only Test)]]]] ["[0]" / - ["[1][0]" watch]] + ["[1][0]" watch] + ["[1][0]" extension]] [\\library ["[0]" /]] [\\specification @@ -288,4 +289,5 @@ false)))) /watch.test + /extension.test )))) diff --git a/stdlib/source/test/lux/world/file/extension.lux b/stdlib/source/test/lux/world/file/extension.lux new file mode 100644 index 000000000..428933939 --- /dev/null +++ b/stdlib/source/test/lux/world/file/extension.lux @@ -0,0 +1,148 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)]] + [data + ["[0]" text] + [collection + ["[0]" list] + ["[0]" set]]] + [math + ["[0]" random (.only Random)] + [number + ["n" nat]]] + [meta + [macro + ["[0]" template]]] + [test + ["_" property (.only Test)]]]] + [\\library + ["[0]" /]]) + +(with_expansions [<extensions> (these [/.compressed_7z_archive] + + [/.archive] + [/.advanced_audio_coding] + [/.agda_source_code] + [/.android_application_package] + [/.assembler_source_code] + + [/.binary] + [/.bzip2_archive] + [/.blender_project] + + [/.c_source_code] + [/.c++_source_code] + [/.java_class] + [/.dos_program] + [/.c#_source_code] + [/.css] + [/.comma_separated_values] + + [/.d_source_code] + [/.dart_source_code] + + [/.emacs_lisp_source_code] + [/.compiled_emacs_lisp_code] + [/.executable_and_linkable_file] + [/.electronic_publication] + [/.erlang_source_code] + [/.executable_program] + + [/.apophysis_fractal] + + [/.gps_exchange_format] + [/.gzip_compressed_data] + + [/.http_archive_format] + [/.c_header] + [/.html] + + [/.optical_disc_file_system] + + [/.java_archive] + [/.java_source_code] + [/.javascript_source_code] + [/.javascript_object_notation] + + [/.llvm_assembly] + [/.lua_source_code] + [/.lzip_archive] + + [/.markdown] + [/.musical_instrument_digital_interface] + + [/.object_code] + [/.vorbis_audio] + + [/.portable_document_format] + [/.php_source_code] + [/.maven_build_configuration] + [/.postscript_source_code] + [/.python_source_code] + + [/.ruby_source_code] + + [/.scheme_source_code] + [/.unix_shell_script] + [/.structured_query_language] + [/.scalable_vector_graphics] + + [/.tape_archive] + [/.temporary_file] + [/.tab_separated_values] + + [/.yaml] + + [/.zip_archive])] + (def .public test + Test + (<| (_.covering /._) + (do [! random.monad] + []) + (_.for [/.Extension]) + (`` (all _.and + (_.coverage [(,, (with_template [<extension>] + [<extension>] + + <extensions>))] + (let [options (list <extensions>) + uniques (set.of_list text.hash options)] + (n.= (list.size options) + (set.size uniques)))) + (,, (with_template [<original> <aliases>] + [(with_expansions [<aliases>' (template.spliced <aliases>)] + (`` (_.coverage [(,, (with_template [<extension>] + [<extension>] + + <aliases>'))] + (and (,, (with_template [<extension>] + [(same? <original> <extension>)] + + <aliases>'))))))] + + [/.c_source_code [[/.c]]] + [/.c++_source_code [[/.c++]]] + [/.comma_separated_values [[/.csv]]] + [/.emacs_lisp_source_code [[/.emacs_lisp]]] + [/.erlang_source_code [[/.erlang]]] + [/.java_archive [[/.jar]]] + [/.java_source_code [[/.java]]] + [/.javascript_source_code [[/.javascript] [/.js]]] + [/.javascript_object_notation [[/.json]]] + [/.lua_source_code [[/.lua]]] + [/.musical_instrument_digital_interface [[/.midi]]] + [/.vorbis_audio [[/.ogg]]] + [/.portable_document_format [[/.pdf]]] + [/.php_source_code [[/.php]]] + [/.python_source_code [[/.python]]] + [/.ruby_source_code [[/.ruby]]] + [/.scheme_source_code [[/.scheme]]] + [/.structured_query_language [[/.sql]]] + [/.scalable_vector_graphics [[/.svg]]] + [/.tape_archive [[/.tar]]] + [/.yaml [[/.yet_another_markup_language] [/.yaml_ain't_markup_language]]] + [/.zip_archive [[/.zip]]] + )) + ))))) |