diff options
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/meta/extension.lux | 27 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/type/primitive.lux | 2 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/mime.lux | 204 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/uri/port.lux | 201 | ||||
-rw-r--r-- | stdlib/source/test/lux/world/net/uri/scheme.lux | 243 |
5 files changed, 345 insertions, 332 deletions
diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux index 1302a74fc..4391469e0 100644 --- a/stdlib/source/test/lux/meta/extension.lux +++ b/stdlib/source/test/lux/meta/extension.lux @@ -67,13 +67,6 @@ (these) (these - (for @.python - ... TODO: Remove this hack once Jython is no longer being used as the Python interpreter. - (analysis ("dummy dum dum" phase archive []) - (undefined)) - - (these)) - ... Analysis (def my_analysis Analysis @@ -101,7 +94,7 @@ (def my_translation|translation Translation (translation (_ phase archive [pass_through <synthesis>.any]) - (phase archive pass_through))) + (phase archive pass_through))) (def my_translation|synthesis Synthesis @@ -127,15 +120,15 @@ (def dummy_translation|translation Translation (translation (_ phase archive []) - (let [[_ self] (symbol ..dummy_translation)] - (at phase.monad in - (for @.jvm (jvm.string self) - @.js (js.string self) - @.python (python.unicode self) - @.lua (lua.string self) - @.ruby (ruby.string self) - @.php (php.string self) - @.scheme (scheme.string self)))))) + (let [[_ self] (symbol ..dummy_translation)] + (at phase.monad in + (for @.jvm (jvm.string self) + @.js (js.string self) + @.python (python.unicode self) + @.lua (lua.string self) + @.ruby (ruby.string self) + @.php (php.string self) + @.scheme (scheme.string self)))))) (def dummy_translation|synthesis Synthesis diff --git a/stdlib/source/test/lux/meta/type/primitive.lux b/stdlib/source/test/lux/meta/type/primitive.lux index 37284d46e..c0bf30297 100644 --- a/stdlib/source/test/lux/meta/type/primitive.lux +++ b/stdlib/source/test/lux/meta/type/primitive.lux @@ -8,7 +8,7 @@ ["[0]" exception]] [data ["[0]" text (.use "[1]#[0]" equivalence)]] - ["[0]" math (.only) + [math ["[0]" random] [number ["n" nat]]] diff --git a/stdlib/source/test/lux/world/net/mime.lux b/stdlib/source/test/lux/world/net/mime.lux index c1116ad5a..3b36e7ecd 100644 --- a/stdlib/source/test/lux/world/net/mime.lux +++ b/stdlib/source/test/lux/world/net/mime.lux @@ -22,89 +22,131 @@ [\\library ["[0]" /]]) -(with_expansions [<options> (these [/.aac] - [/.abiword] - [/.avi] - [/.amazon_kindle_ebook] - [/.binary] - [/.bitmap] - [/.bzip] - [/.bzip2] - [/.c_shell] - [/.css] - [/.csv] - [/.microsoft_word] - [/.microsoft_word_openxml] - [/.ms_embedded_opentype_fonts] - [/.epub] - [/.ecmascript] - [/.gif] - [/.html] - [/.icon] - [/.icalendar] - [/.jar] - [/.jpeg] - [/.javascript] - [/.json] - [/.midi] - [/.mpeg] - [/.apple_installer_package] - [/.opendocument_presentation] - [/.opendocument_spreadsheet] - [/.opendocument_text] - [/.ogg_audio] - [/.ogg_video] - [/.ogg] - [/.opentype_font] - [/.png] - [/.pdf] - [/.microsoft_powerpoint] - [/.microsoft_powerpoint_openxml] - [/.rar] - [/.rtf] - [/.bourne_shell] - [/.svg] - [/.flash] - [/.tar] - [/.tiff] - [/.typescript] - [/.truetype_font] - [/.microsoft_visio] - [/.wav] - [/.webm_audio] - [/.webm_video] - [/.webp] - [/.woff] - [/.woff2] - [/.xhtml] - [/.microsoft_excel] - [/.microsoft_excel_openxml] - [/.xml] - [/.xul] - [/.zip] +(with_expansions [<randoms> (with_template [<name> <options>] + [(def <name> + (Random /.MIME) + (`` (all random.either + (,, (with_template [<type>] + [(random#in <type>)] + + <options>)) + )))] - [/.audio_3gpp] - [/.video_3gpp] - [/.audio_3gpp2] - [/.video_3gpp2] - [/.compressed_7z] + [random/0 <options/0>] + [random/1 <options/1>] + [random/2 <options/2>] + [random/3 <options/3>] + ) + <coverages> (with_template [<options>] + [(`` (_.coverage [(,, (with_template [<type>] + [<type>] + + <options> + ))] + (let [uniques (set.of_list /.hash ..options)] + (n.= (list.size ..options) + (set.size uniques)))))] - [/.form] - [/.multi_part_form] + [<options/0>] + [<options/1>] + [<options/2>] + [<options/3>] + ) + <all_options> (with_template [<options>] + [(is (List /.MIME) + (let [options (is (-> Any (List /.MIME)) + (function (_ _) + (list <options>)))] + (options [])))] + + [<options/0>] + [<options/1>] + [<options/2>] + [<options/3>] + ) + <options/0> (these [/.aac] + [/.abiword] + [/.avi] + [/.amazon_kindle_ebook] + [/.binary] + [/.bitmap] + [/.bzip] + [/.bzip2] + [/.c_shell] + [/.css] + [/.csv] + [/.microsoft_word] + [/.microsoft_word_openxml] + [/.ms_embedded_opentype_fonts] + [/.epub] + [/.ecmascript] + [/.gif] + [/.html] + [/.icon] + [/.icalendar] + [/.jar] + [/.jpeg] + [/.javascript] + [/.json] + [/.midi] + [/.mpeg]) + <options/1> (these [/.apple_installer_package] + [/.opendocument_presentation] + [/.opendocument_spreadsheet] + [/.opendocument_text] + [/.ogg_audio] + [/.ogg_video] + [/.ogg] + [/.opentype_font] + [/.png] + [/.pdf] + [/.microsoft_powerpoint] + [/.microsoft_powerpoint_openxml] + [/.rar] + [/.rtf] + [/.bourne_shell] + [/.svg] + [/.flash]) + <options/2> (these [/.tar] + [/.tiff] + [/.typescript] + [/.truetype_font] + [/.microsoft_visio] + [/.wav] + [/.webm_audio] + [/.webm_video] + [/.webp] + [/.woff] + [/.woff2] + [/.xhtml] + [/.microsoft_excel] + [/.microsoft_excel_openxml] + [/.xml] + [/.xul] + [/.zip]) + <options/3> (these [/.audio_3gpp] + [/.video_3gpp] + [/.audio_3gpp2] + [/.video_3gpp2] + [/.compressed_7z] + + [/.form] + [/.multi_part_form] + + [/.utf_8])] + <randoms> - [/.utf_8]) - <types> (with_template [<type>] - [<type>] - - <options>)] (def .public random (Random /.MIME) - (`` (all random.either - (,, (with_template [<type>] - [(random#in <type>)] - - <options>)) - ))) + (all random.either + ..random/0 + ..random/1 + ..random/2 + )) + + (def options + (List /.MIME) + (list.together (list <all_options>))) (def .public test Test @@ -124,11 +166,7 @@ /.name /.mime (at /.equivalence = expected))) - (_.coverage [<types>] - (let [options (list <types>) - uniques (set.of_list /.hash options)] - (n.= (list.size options) - (set.size uniques)))) + <coverages> (_.coverage [/.text] (|> (/.text encoding) /.name diff --git a/stdlib/source/test/lux/world/net/uri/port.lux b/stdlib/source/test/lux/world/net/uri/port.lux index 73ee68337..ea56944b0 100644 --- a/stdlib/source/test/lux/world/net/uri/port.lux +++ b/stdlib/source/test/lux/world/net/uri/port.lux @@ -16,93 +16,124 @@ [\\library ["[0]" /]]) -(with_expansions [<options> (these [/.echo_protocol] - [/.discard_protocol] - [/.daytime_protocol] - [/.quote_of_the_day] - [/.message_send_protocol] - [/.character_generator_protocol] - [/.file_transfer_protocol_data_transfer] - [/.file_transfer_protocol_control] - [/.telnet] - [/.simple_mail_transfer_protocol] - [/.time_protocol] - [/.host_name_server_protocol] - [/.whois] - [/.domain_name_system] - [/.gopher] - [/.finger] - [/.hypertext_transfer_protocol] - [/.kerberos] - - [/.digital_imaging_and_communications_in_medicine] - [/.remote_user_telnet_service] - [/.post_office_protocol_2] - [/.post_office_protocol_3] - [/.open_network_computing_remote_procedure_call] - [/.simple_file_transfer_protocol] - [/.network_news_transfer_protocol] - [/.network_time_protocol] - [/.internet_message_access_protocol] - [/.simple_gateway_monitoring_protocol] - [/.structured_query_language] - [/.simple_network_management_protocol] - [/.simple_network_management_protocol_trap] - [/.secure_neighbor_discovery] - [/.x_display_manager_control_protocol] - [/.border_gateway_protocol] - [/.internet_relay_chat] - [/.snmp_unix_multiplexer] - - [/.border_gateway_multicast_protocol] - - [/.precision_time_protocol_event_messages] - [/.precision_time_protocol_general_messages] - [/.lightweight_directory_access_protocol] - - [/.uninterruptible_power_supply] - [/.service_location_protocol] - [/.hypertext_transfer_protocol_secure] - [/.simple_network_paging_protocol] - [/.kerberos_change/set_password] - - [/.remote_procedure_call] - [/.real_time_streaming_protocol] - [/.dynamic_host_configuration_protocol/6_client] - [/.dynamic_host_configuration_protocol/6_server] - [/.network_news_transfer_protocol_secure] - - [/.internet_printing_protocol] - [/.lightweight_directory_access_protocol_secure] - [/.multicast_source_discovery_protocol] - [/.label_distribution_protocol] - [/.application_configuration_access_protocol] - [/.optimized_link_state_routing_protocol] - - [/.extensible_provisioning_protocol] - [/.link_management_protocol] - [/.secure_internet_live_conferencing_protocol] - [/.kerberos_administration] - - [/.certificate_management_protocol] - [/.network_configuration_protocol/ssh] - [/.network_configuration_protocol/beep] - [/.network_configuration_protocol/soap/https] - [/.network_configuration_protocol/soap/beep] - - [/.file_transfer_protocol_secure_data_transfer] - [/.file_transfer_protocol_secure_control] - [/.telnet/tls] - [/.internet_message_access_protocol_secure] - [/.post_office_protocol_3_secure])] +(with_expansions [<all_options> (with_template [<>] + [(is (List /.Port) + (let [it (is (-> Any (List /.Port)) + (function (_ _) + (list <>)))] + (it [])))] + + [<options/0>] + [<options/1>] + [<options/2>] + [<options/3>] + ) + <coverages> (with_template [<options>] + [(_.coverage [(,, (with_template [<port>] + [<port>] + + <options> + ))] + (let [uniques (set.of_list nat.hash ..options)] + (nat.= (list.size ..options) + (set.size uniques))))] + + [<options/0>] + [<options/1>] + [<options/2>] + [<options/3>] + ) + <options/0> (these [/.echo_protocol] + [/.discard_protocol] + [/.daytime_protocol] + [/.quote_of_the_day] + [/.message_send_protocol] + [/.character_generator_protocol] + [/.file_transfer_protocol_data_transfer] + [/.file_transfer_protocol_control] + [/.telnet] + [/.simple_mail_transfer_protocol] + [/.time_protocol] + [/.host_name_server_protocol] + [/.whois] + [/.domain_name_system] + [/.gopher] + [/.finger] + [/.hypertext_transfer_protocol] + [/.kerberos]) + <options/1> (these [/.digital_imaging_and_communications_in_medicine] + [/.remote_user_telnet_service] + [/.post_office_protocol_2] + [/.post_office_protocol_3] + [/.open_network_computing_remote_procedure_call] + [/.simple_file_transfer_protocol] + [/.network_news_transfer_protocol] + [/.network_time_protocol] + [/.internet_message_access_protocol] + [/.simple_gateway_monitoring_protocol] + [/.structured_query_language] + [/.simple_network_management_protocol] + [/.simple_network_management_protocol_trap] + [/.secure_neighbor_discovery] + [/.x_display_manager_control_protocol] + [/.border_gateway_protocol] + [/.internet_relay_chat] + [/.snmp_unix_multiplexer]) + <options/2> (these [/.border_gateway_multicast_protocol] + + [/.precision_time_protocol_event_messages] + [/.precision_time_protocol_general_messages] + [/.lightweight_directory_access_protocol] + + [/.uninterruptible_power_supply] + [/.service_location_protocol] + [/.hypertext_transfer_protocol_secure] + [/.simple_network_paging_protocol] + [/.kerberos_change/set_password] + + [/.remote_procedure_call] + [/.real_time_streaming_protocol] + [/.dynamic_host_configuration_protocol/6_client] + [/.dynamic_host_configuration_protocol/6_server] + [/.network_news_transfer_protocol_secure]) + <options/3> (these [/.internet_printing_protocol] + [/.lightweight_directory_access_protocol_secure] + [/.multicast_source_discovery_protocol] + [/.label_distribution_protocol] + [/.application_configuration_access_protocol] + [/.optimized_link_state_routing_protocol] + + [/.extensible_provisioning_protocol] + [/.link_management_protocol] + [/.secure_internet_live_conferencing_protocol] + [/.kerberos_administration] + + [/.certificate_management_protocol] + [/.network_configuration_protocol/ssh] + [/.network_configuration_protocol/beep] + [/.network_configuration_protocol/soap/https] + [/.network_configuration_protocol/soap/beep] + + [/.file_transfer_protocol_secure_data_transfer] + [/.file_transfer_protocol_secure_control] + [/.telnet/tls] + [/.internet_message_access_protocol_secure] + [/.post_office_protocol_3_secure])] (def .public random (Random /.Port) (`` (all random.either (,, (with_template [<port>] [(random#in <port>)] - <options> + <options/0> + <options/1> + <options/2> + <options/3> ))))) + + (def options + (List /.Port) + (list.together (list <all_options>))) (def .public test Test @@ -111,15 +142,7 @@ []) (_.for [/.Port]) (`` (all _.and - (_.coverage [(,, (with_template [<port>] - [<port>] - - <options> - ))] - (let [options (list <options>) - uniques (set.of_list nat.hash options)] - (nat.= (list.size options) - (set.size uniques)))) + <coverages> (,, (with_template [<long> <short>] [(_.coverage [<short>] (same? <long> <short>))] diff --git a/stdlib/source/test/lux/world/net/uri/scheme.lux b/stdlib/source/test/lux/world/net/uri/scheme.lux index 868f2cddf..4a651646c 100644 --- a/stdlib/source/test/lux/world/net/uri/scheme.lux +++ b/stdlib/source/test/lux/world/net/uri/scheme.lux @@ -19,145 +19,104 @@ [\\library ["[0]" /]]) -(def .public random - (Random /.Scheme) - (all random.either - (random#in /.about) - (random#in /.acap) - (random#in /.user_account) - (random#in /.anonymous_customer_reference) - (random#in /.attachment) - - (random#in /.bitcoin) - (random#in /.blob) - - (random#in /.calendar_access_protocol) - - (random#in /.data) - (random#in /.dns) - (random#in /.dntp) - (random#in /.digital_object_identifier) - (random#in /.drm) - - (random#in /.feed) - (random#in /.file) - (random#in /.finger) - (random#in /.fish) - (random#in /.fm) - (random#in /.ftp) - - (random#in /.geo) - (random#in /.git) - - (random#in /.http) - (random#in /.https) - - (random#in /.imap) - (random#in /.ipp) - (random#in /.ipps) - (random#in /.irc) - (random#in /.irc6) - (random#in /.ircs) - - (random#in /.jar) - - (random#in /.ldap) - (random#in /.ldaps) - - (random#in /.magnet) - (random#in /.mail_to) - (random#in /.apache_maven) - - (random#in /.pop) - - (random#in /.sip) - (random#in /.sips) - (random#in /.sms) - (random#in /.snmp) - (random#in /.ssh) - (random#in /.stun) - (random#in /.stuns) - - (random#in /.telephone_number) - (random#in /.turn) - (random#in /.turns) - - (random#in /.xmpp) - )) - -(def .public test - Test - (<| (_.covering /._) - (do [! random.monad] - [expected ..random]) - (_.for [/.Scheme]) - (`` (all _.and - (_.for [/.equivalence] - ($equivalence.spec /.equivalence ..random)) - (_.for [/.hash] - ($hash.spec /.hash ..random)) - - (_.coverage [/.name /.scheme] - (|> expected - /.name - /.scheme - (at /.equivalence = expected))) - (with_expansions [<schemes> (these /.about /.acap /.user_account /.anonymous_customer_reference /.attachment - /.bitcoin /.blob - /.calendar_access_protocol - /.data /.dns /.dntp /.digital_object_identifier /.drm - /.feed /.file /.finger /.fish /.fm /.ftp - /.geo /.git - /.http /.https - /.imap /.ipp /.ipps /.irc /.irc6 /.ircs - /.jar - /.ldap /.ldaps - /.magnet /.mail_to /.apache_maven - /.pop - /.sip /.sips /.sms /.snmp /.ssh /.stun /.stuns - /.telephone_number /.turn /.turns - /.xmpp)] - (_.coverage [<schemes>] - (let [options (list <schemes>) - uniques (set.of_list /.hash options)] - (n.= (list.size options) - (set.size uniques))))) - (,, (with_template [<original> <alias>] - [(_.coverage [<alias>] - (at /.equivalence = <original> <alias>))] - - [/.acap /.application_configuration_access_protocol] - - [/.dns /.domain_name_system] - [/.dntp /.direct_network_transfer_protocol] - - [/.ftp /.file_transfer_protocol] - - [/.http /.hypertext_transfer_protocol] - [/.https /.hypertext_transfer_protocol_secure] - - [/.imap /.internet_message_access_protocol] - [/.ipp /.internet_printing_protocol] - [/.ipps /.internet_printing_protocol_secure] - [/.irc /.internet_relay_chat] - [/.ircs /.internet_relay_chat_secure] - - [/.ldap /.lightweight_directory_access_protocol] - [/.ldaps /.lightweight_directory_access_protocol_secure] - - [/.pop /.post_office_protocol] - - [/.sip /.session_initiation_protocol] - [/.sips /.session_initiation_protocol_secure] - [/.sms /.short_message_service] - [/.snmp /.simple_network_management_protocol] - [/.ssh /.secure_shell_protocol] - - [/.stun /.session_traversal_utilities_for_nat] - [/.stuns /.session_traversal_utilities_for_nat_secure] - - [/.turn /.traversal_using_relays_around_nat] - [/.turns /.traversal_using_relays_around_nat_secure] - - [/.xmpp /.extensible_messaging_and_presence_protocol])) - )))) +(with_expansions [<schemes/0> (these [/.about] [/.acap] [/.user_account] [/.anonymous_customer_reference] [/.attachment] + [/.bitcoin] [/.blob] + [/.calendar_access_protocol] + [/.data] [/.dns] [/.dntp] [/.digital_object_identifier] [/.drm] + [/.feed] [/.file] [/.finger] [/.fish] [/.fm] [/.ftp] + [/.geo] [/.git] + [/.http] [/.https]) + <schemes/1> (these [/.imap] [/.ipp] [/.ipps] [/.irc] [/.irc6] [/.ircs] + [/.jar] + [/.ldap] [/.ldaps] + [/.magnet] [/.mail_to] [/.apache_maven] + [/.pop] + [/.sip] [/.sips] [/.sms] [/.snmp] [/.ssh] [/.stun] [/.stuns] + [/.telephone_number] [/.turn] [/.turns] + [/.xmpp])] + (def .public random + (Random /.Scheme) + (`` (all random.either + (,, (with_template [<scheme>] + [(random#in <scheme>)] + + <schemes/0> + <schemes/1> + )) + ))) + + (def options + (List /.Scheme) + (list <schemes/0> + <schemes/1>)) + + (def .public test + Test + (<| (_.covering /._) + (do [! random.monad] + [expected ..random]) + (_.for [/.Scheme]) + (`` (all _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence ..random)) + (_.for [/.hash] + ($hash.spec /.hash ..random)) + + (_.coverage [/.name /.scheme] + (|> expected + /.name + /.scheme + (at /.equivalence = expected))) + (_.coverage [(,, (with_template [<scheme>] + [<scheme>] + + <schemes/0>))] + (let [uniques (set.of_list /.hash ..options)] + (n.= (list.size ..options) + (set.size uniques)))) + (_.coverage [(,, (with_template [<scheme>] + [<scheme>] + + <schemes/1>))] + (let [uniques (set.of_list /.hash ..options)] + (n.= (list.size ..options) + (set.size uniques)))) + (,, (with_template [<original> <alias>] + [(_.coverage [<alias>] + (at /.equivalence = <original> <alias>))] + + [/.acap /.application_configuration_access_protocol] + + [/.dns /.domain_name_system] + [/.dntp /.direct_network_transfer_protocol] + + [/.ftp /.file_transfer_protocol] + + [/.http /.hypertext_transfer_protocol] + [/.https /.hypertext_transfer_protocol_secure] + + [/.imap /.internet_message_access_protocol] + [/.ipp /.internet_printing_protocol] + [/.ipps /.internet_printing_protocol_secure] + [/.irc /.internet_relay_chat] + [/.ircs /.internet_relay_chat_secure] + + [/.ldap /.lightweight_directory_access_protocol] + [/.ldaps /.lightweight_directory_access_protocol_secure] + + [/.pop /.post_office_protocol] + + [/.sip /.session_initiation_protocol] + [/.sips /.session_initiation_protocol_secure] + [/.sms /.short_message_service] + [/.snmp /.simple_network_management_protocol] + [/.ssh /.secure_shell_protocol] + + [/.stun /.session_traversal_utilities_for_nat] + [/.stuns /.session_traversal_utilities_for_nat_secure] + + [/.turn /.traversal_using_relays_around_nat] + [/.turns /.traversal_using_relays_around_nat_secure] + + [/.xmpp /.extensible_messaging_and_presence_protocol])) + ))))) |