From bae39f32cddb816a6123697269c20dbf4a65ac19 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 9 Oct 2020 01:16:47 -0400 Subject: Also using BIPUSH and SIPUSH during JVM generation. --- stdlib/source/test/aedifex/parser.lux | 108 +++------------------------------- 1 file changed, 7 insertions(+), 101 deletions(-) (limited to 'stdlib/source/test/aedifex/parser.lux') diff --git a/stdlib/source/test/aedifex/parser.lux b/stdlib/source/test/aedifex/parser.lux index 97895a201..988883779 100644 --- a/stdlib/source/test/aedifex/parser.lux +++ b/stdlib/source/test/aedifex/parser.lux @@ -10,8 +10,7 @@ [parser ["" code]]] [data - ["." text - ["%" format (#+ format)]] + ["." text] [number ["n" nat]] [collection @@ -22,6 +21,8 @@ ["." random (#+ Random) ("#@." monad)]] [macro ["." code]]] + [// + ["_." profile]] {#program ["." / ["/#" // #_ @@ -31,120 +32,25 @@ ["#." dependency (#+ Repository Dependency)] ["#." format]]]}) -(def: distribution - (Random //.Distribution) - (random.or (random@wrap []) - (random@wrap []))) - -(def: license - (Random //.License) - ($_ random.and - (random.ascii/alpha 1) - (random.ascii/alpha 1) - ..distribution)) - -(def: scm - (Random //.SCM) - (random.ascii/alpha 1)) - -(def: organization - (Random //.Organization) - ($_ random.and - (random.ascii/alpha 1) - (random.ascii/alpha 1))) - -(def: email - (Random //.Email) +(def: name + (Random //.Name) (random.ascii/alpha 1)) -(def: developer - (Random //.Developer) - ($_ random.and - (random.ascii/alpha 1) - (random.ascii/alpha 1) - (random.maybe organization))) - -(def: contributor - (Random //.Contributor) - ..developer) - (def: (list-of random) (All [a] (-> (Random a) (Random (List a)))) (do {@ random.monad} [size (:: @ map (n.% 5) random.nat)] (random.list size random))) -(def: (set-of hash random) - (All [a] (-> (Hash a) (Random a) (Random (Set a)))) - (:: random.functor map - (set.from-list hash) - (..list-of random))) - (def: (dictionary-of key-hash key-random value-random) (All [k v] (-> (Hash k) (Random k) (Random v) (Random (Dictionary k v)))) (:: random.functor map (dictionary.from-list key-hash) (..list-of (random.and key-random value-random)))) -(def: info - (Random //.Info) - ($_ random.and - (random.maybe (random.ascii/alpha 1)) - (random.maybe ..scm) - (random.maybe (random.ascii/alpha 1)) - (..list-of ..license) - (random.maybe ..organization) - (..list-of ..developer) - (..list-of ..contributor) - )) - -(def: name - (Random //.Name) - (random.ascii/alpha 1)) - -(def: artifact - (Random Artifact) - ($_ random.and - (random.ascii/alpha 1) - (random.ascii/alpha 1) - (random.ascii/alpha 1))) - -(def: repository - (Random Repository) - (random.ascii/alpha 1)) - -(def: dependency - (Random Dependency) - ($_ random.and - ..artifact - (random.ascii/alpha 1))) - -(def: source - (Random //.Source) - (random.ascii/alpha 1)) - -(def: target - (Random //.Target) - (random.ascii/alpha 1)) - -(def: profile - (Random //.Profile) - ($_ random.and - (..list-of ..name) - (random.maybe ..artifact) - (random.maybe ..info) - (..set-of text.hash ..repository) - (..set-of //dependency.hash ..dependency) - (..set-of text.hash ..source) - (random.maybe ..target) - (random.maybe (random.ascii/alpha 1)) - (random.maybe (random.ascii/alpha 1)) - (..dictionary-of text.hash (random.ascii/alpha 1) ..repository) - )) - (def: project (Random Project) - (..dictionary-of text.hash ..name ..profile)) + (..dictionary-of text.hash ..name _profile.random)) (def: with-default-sources (-> //.Profile //.Profile) @@ -158,7 +64,7 @@ (def: single-profile Test (do random.monad - [expected ..profile] + [expected _profile.random] (_.test "Single profile." (|> expected //format.profile -- cgit v1.2.3