Merge branch 'idea-kotlin' into 'master'
Convert to intellij and kotlin See merge request mike-cifelli/transcendental-lisp!1
This commit is contained in:
commit
04a4164c1b
31
.classpath
31
.classpath
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="test">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="lisp/lang">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
|
@ -1,7 +1,12 @@
|
|||
.idea/**/libraries
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/workspace.xml
|
||||
.idea/dictionaries
|
||||
fitnesse/FitNesseRoot/files
|
||||
fitnesse/FitNesseRoot/FitNesse/UserGuide/
|
||||
fitnesse/fitnesse-results
|
||||
target/
|
||||
*.iml
|
||||
*.swp
|
||||
*.zip
|
||||
dependency-reduced-pom.xml
|
||||
dependency-reduced-pom.xml
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ClojureProjectResolveSettings">
|
||||
<currentScheme>IDE</currentScheme>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,92 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION" value="true" />
|
||||
<option name="ANNOTATION_PARAMETER_WRAP" value="5" />
|
||||
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="javax" withSubpackages="true" static="false" />
|
||||
<package name="java" withSubpackages="true" static="false" />
|
||||
<emptyLine />
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value />
|
||||
</option>
|
||||
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
|
||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
|
||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
|
||||
<option name="IMPORT_NESTED_CLASSES" value="true" />
|
||||
<option name="CONTINUATION_INDENT_FOR_EXPRESSION_BODIES" value="false" />
|
||||
<option name="CONTINUATION_INDENT_FOR_CHAINED_CALLS" value="false" />
|
||||
<option name="WRAP_EXPRESSION_BODY_FUNCTIONS" value="1" />
|
||||
</JetCodeStyleSettings>
|
||||
<XML>
|
||||
<option name="XML_ATTRIBUTE_WRAP" value="4" />
|
||||
<option name="XML_KEEP_BLANK_LINES" value="1" />
|
||||
<option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
||||
</XML>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
|
||||
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
|
||||
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
||||
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
|
||||
<option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" />
|
||||
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="5" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="RESOURCE_LIST_WRAP" value="5" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="5" />
|
||||
<option name="THROWS_LIST_WRAP" value="5" />
|
||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
||||
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="1" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
|
||||
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="5" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="ENUM_CONSTANTS_WRAP" value="5" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="5" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="EXTENDS_LIST_WRAP" value="5" />
|
||||
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="FIELD_ANNOTATION_WRAP" value="1" />
|
||||
<option name="ENUM_CONSTANTS_WRAP" value="5" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
|
@ -0,0 +1,5 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Mike" />
|
||||
</state>
|
||||
</component>
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="transcendental-lisp" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="transcendental-lisp" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="RemoveRedundantBackticks" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Kotlin2JsCompilerArguments">
|
||||
<option name="sourceMapEmbedSources" />
|
||||
<option name="sourceMapPrefix" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/classes" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/transcendental-lisp.iml" filepath="$PROJECT_DIR$/transcendental-lisp.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,27 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build" type="MavenRunConfiguration" factoryName="Maven">
|
||||
<MavenSettings>
|
||||
<option name="myGeneralSettings" />
|
||||
<option name="myRunnerSettings" />
|
||||
<option name="myRunnerParameters">
|
||||
<MavenRunnerParameters>
|
||||
<option name="profiles">
|
||||
<set />
|
||||
</option>
|
||||
<option name="goals">
|
||||
<list>
|
||||
<option value="clean" />
|
||||
<option value="verify" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="profilesMap">
|
||||
<map />
|
||||
</option>
|
||||
<option name="resolveToWorkspace" value="false" />
|
||||
<option name="workingDirPath" value="$PROJECT_DIR$" />
|
||||
</MavenRunnerParameters>
|
||||
</option>
|
||||
</MavenSettings>
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -0,0 +1,11 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="FitNesse" type="JarApplication" factoryName="JAR Application" singleton="true">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="JAR_PATH" value="$PROJECT_DIR$/fitnesse/fitnesse-standalone.jar" />
|
||||
<option name="PROGRAM_PARAMETERS" value="-p 5150 -d fitnesse" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -0,0 +1,24 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Test" type="JUnit" factoryName="JUnit">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<module name="transcendental-lisp" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="PACKAGE_NAME" value="" />
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://%MODULE_WORKING_DIR%" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<option name="TEST_SEARCH_SCOPE">
|
||||
<value defaultName="singleModule" />
|
||||
</option>
|
||||
<envs />
|
||||
<dir value="$PROJECT_DIR$/src/test/java" />
|
||||
<patterns />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
29
.project
29
.project
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Transcendental Lisp</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/java"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-jar fitnesse/fitnesse-standalone.jar -p 5150 -d fitnesse"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Transcendental Lisp}"/>
|
||||
</launchConfiguration>
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Transcendental Lisp"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.eclemma.core.SCOPE_IDS">
|
||||
<listEntry value="=Transcendental Lisp/src"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=Transcendental Lisp"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Transcendental Lisp"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
|
||||
</launchConfiguration>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
|
||||
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
|
||||
<stringAttribute key="M2_GOALS" value="clean verify"/>
|
||||
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
|
||||
<booleanAttribute key="M2_OFFLINE" value="false"/>
|
||||
<stringAttribute key="M2_PROFILES" value=""/>
|
||||
<listAttribute key="M2_PROPERTIES"/>
|
||||
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
|
||||
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
|
||||
<intAttribute key="M2_THREADS" value="1"/>
|
||||
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
|
||||
<stringAttribute key="M2_USER_SETTINGS" value=""/>
|
||||
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:Transcendental Lisp}"/>
|
||||
</launchConfiguration>
|
|
@ -1,5 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//lisp/lang=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
encoding/src=UTF-8
|
||||
encoding/test=UTF-8
|
|
@ -1,13 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
|
@ -1,4 +0,0 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
|
@ -1,12 +1,12 @@
|
|||
There are cases when you want to copy and append the last row of your column or row fixture certain number of times.
|
||||
|
||||
For Ex: We make a query to the database and it return certain record 'n' number of times. Instead of writing the same record 'n' number of times in your fitnesse page, you can just specify that you expect the last column 'n' number of times using the !-CopyAndAppendLastRow-! decorator.
|
||||
|
||||
!|Copy and Append Last Row|100|number of times|
|
||||
|Division|
|
||||
|numerator|denominator|quotient()|
|
||||
|10|2|5|
|
||||
|12.6|3|4.2|
|
||||
|100|4|25|
|
||||
|
||||
In the above example, we want to divide 100 by 4 101 times.
|
||||
There are cases when you want to copy and append the last row of your column or row fixture certain number of times.
|
||||
|
||||
For Ex: We make a query to the database and it return certain record 'n' number of times. Instead of writing the same record 'n' number of times in your fitnesse page, you can just specify that you expect the last column 'n' number of times using the !-CopyAndAppendLastRow-! decorator.
|
||||
|
||||
!|Copy and Append Last Row|100|number of times|
|
||||
|Division|
|
||||
|numerator|denominator|quotient()|
|
||||
|10|2|5|
|
||||
|12.6|3|4.2|
|
||||
|100|4|25|
|
||||
|
||||
In the above example, we want to divide 100 by 4 101 times.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit/>
|
||||
<Files/>
|
||||
<LastModified>20061216213113</LastModified>
|
||||
<Properties/>
|
||||
<RecentChanges/>
|
||||
<Test/>
|
||||
<WhereUsed/>
|
||||
<saveId>1166322673244</saveId>
|
||||
<secure-write/>
|
||||
<ticketId>524008525574625139</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit/>
|
||||
<Files/>
|
||||
<LastModified>20061216213113</LastModified>
|
||||
<Properties/>
|
||||
<RecentChanges/>
|
||||
<Test/>
|
||||
<WhereUsed/>
|
||||
<saveId>1166322673244</saveId>
|
||||
<secure-write/>
|
||||
<ticketId>524008525574625139</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
What if you want to call the fixture 'n' times with the same row except you want to update one or two column's value?
|
||||
|
||||
Ex: If you are using fitnesse fixtures to populate database and you want to insert a record 500 times. It would be easy to write one model record and insert that 500 times. This can be easily done with the !-CopyAndAppendLastRow-! decorator. But the database table might have a primary key. So you might want to update the primary key in each row. Now you might want to pipe !-IncrementColumnsValue-! and !-CopyAndAppendLastRow-! decorators to get the job done.
|
||||
|
||||
Here is an example where I want to divide 5 by 1, 100 times, but I also want to update the numerator by 5 and denominator by 1.
|
||||
|
||||
!|Copy and Append Last Row|100|times|
|
||||
|Increment Columns Value|numerator|of type|int|by|5|
|
||||
|Increment Columns Value|denominator|of type|int|by|1|
|
||||
|Division|
|
||||
|numerator|denominator|quotient()|
|
||||
|5|1|5|
|
||||
What if you want to call the fixture 'n' times with the same row except you want to update one or two column's value?
|
||||
|
||||
Ex: If you are using fitnesse fixtures to populate database and you want to insert a record 500 times. It would be easy to write one model record and insert that 500 times. This can be easily done with the !-CopyAndAppendLastRow-! decorator. But the database table might have a primary key. So you might want to update the primary key in each row. Now you might want to pipe !-IncrementColumnsValue-! and !-CopyAndAppendLastRow-! decorators to get the job done.
|
||||
|
||||
Here is an example where I want to divide 5 by 1, 100 times, but I also want to update the numerator by 5 and denominator by 1.
|
||||
|
||||
!|Copy and Append Last Row|100|times|
|
||||
|Increment Columns Value|numerator|of type|int|by|5|
|
||||
|Increment Columns Value|denominator|of type|int|by|1|
|
||||
|Division|
|
||||
|numerator|denominator|quotient()|
|
||||
|5|1|5|
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit/>
|
||||
<Files/>
|
||||
<LastModified>20061216215829</LastModified>
|
||||
<Properties/>
|
||||
<RecentChanges/>
|
||||
<Test/>
|
||||
<WhereUsed/>
|
||||
<saveId>1166324308994</saveId>
|
||||
<secure-write/>
|
||||
<ticketId>-8528063939302055872</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit/>
|
||||
<Files/>
|
||||
<LastModified>20061216215829</LastModified>
|
||||
<Properties/>
|
||||
<RecentChanges/>
|
||||
<Test/>
|
||||
<WhereUsed/>
|
||||
<saveId>1166324308994</saveId>
|
||||
<secure-write/>
|
||||
<ticketId>-8528063939302055872</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
!|Import|
|
||||
|fit.decorator|
|
||||
|fit.decorator.performance|
|
||||
|eg|
|
||||
!|Import|
|
||||
|fit.decorator|
|
||||
|fit.decorator.performance|
|
||||
|eg|
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<LastModified>20061216183948</LastModified>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
<saveId>1166312388007</saveId>
|
||||
<ticketId>-6757238585913794424</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<LastModified>20061216183948</LastModified>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
<saveId>1166312388007</saveId>
|
||||
<ticketId>-6757238585913794424</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1 +1 @@
|
|||
!|fit.Summary|
|
||||
!|fit.Summary|
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<LastModified>20061216141632</LastModified>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
<saveId>1166296592283</saveId>
|
||||
<ticketId>-5128325404176707243</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<LastModified>20061216141632</LastModified>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
<saveId>1166296592283</saveId>
|
||||
<ticketId>-5128325404176707243</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,145 +1,145 @@
|
|||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
|
||||
Test Strings by plain compare, neither custom compare nor regular expression.
|
||||
In this case detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | abc | equal |
|
||||
| abc | xyz | completly different |
|
||||
| abc | xbc | first char different |
|
||||
| abc | ayc | middle char different |
|
||||
| abc | abz | last char different |
|
||||
| | xyz | actual empty, expected filled |
|
||||
| abc | | actual filled, expected empty; will be counted as ignored |
|
||||
| <&> | <&> | equal with HTML special chars |
|
||||
| <&> | xyz | completly different with HTML special chars |
|
||||
| <&> | x&> | first char different with HTML special chars |
|
||||
| <&> | <y> | middle char different with HTML special chars |
|
||||
| <&> | <&z | last char differentwith HTML special chars |
|
||||
| | <&> | actual empty, expected filled with HTML special chars |
|
||||
| abc | <&> | completly different with HTML special chars |
|
||||
| abc | <bc | first char different with HTML special chars |
|
||||
| abc | a&c | middle char different with HTML special chars |
|
||||
| abc | ab> | last char different with HTML special chars |
|
||||
| Hello World | Wellcome Lord | no obvious match |
|
||||
|
||||
Test Strings by regular expression.
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | =~/abc/ | match |
|
||||
| abc | =~/a.c/ | match |
|
||||
| abc | =~/\w+/ | match |
|
||||
| abc | =~/\w{3}/ | match |
|
||||
| abc | =~/^\w{3}$/ | match |
|
||||
| abc | =~/\w{1}/ | match |
|
||||
| abc | =~/^\w{1}$/ | no match |
|
||||
| abc | =~/[ABC]+/ | no match |
|
||||
| abc | =~/[ABC]+/i | wrong syntax, disable value comparison, use string comparison |
|
||||
|
||||
|
||||
Test integers by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | 1 | equal |
|
||||
| 1 | 2 | completly different |
|
||||
| 1 | 10 | partially different |
|
||||
| | 1 | completly different |
|
||||
|
||||
Test integers by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
|
||||
|
||||
Test doubles by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1.0 | 1.0 | equal |
|
||||
| 1.1 | 222 | completly different |
|
||||
| 1.0 | 10 | partially different |
|
||||
| | 1.0 | partially different |
|
||||
|
||||
Test doubles by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1.0 | ~=1 | ok |
|
||||
| 1.1 | ~=1 | ok |
|
||||
| 0.9 | ~=1 | ok |
|
||||
| 1.0 | ~=1.0 | ok |
|
||||
| 1.1 | ~=1.0 | nok |
|
||||
| 0.9 | ~=1.0 | nok |
|
||||
|
||||
|
||||
Test symbols by string comparison.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual symbol | expected symbol? | #comment |
|
||||
| abc | $symbol= | |
|
||||
| $symbol | abc | |
|
||||
| $symbol | xyz | |
|
||||
| $symbol | xbc | |
|
||||
| $symbol | ayc | |
|
||||
| $symbol | abz | |
|
||||
| abc | $symbol | |
|
||||
| xyz | $symbol | |
|
||||
| xbc | $symbol | |
|
||||
| ayc | $symbol | |
|
||||
| abz | $symbol | |
|
||||
| | $symbol | |
|
||||
|
||||
|
||||
Test custom comparator, see FitNesse.UserGuide.AdministeringFitNesse.ConfigurationFile
|
||||
The inverse comparator fitnesse.slim.test.InverseComparator negates the method String.equals(String).
|
||||
|
||||
| script | Detailed Diff |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:xyz |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:ABC |
|
||||
| note | everthing not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:cba |
|
||||
| note | only 'abc' is nok |
|
||||
| check | echo | abc | inverse:abc |
|
||||
|
||||
|
||||
Test Scenario and Script
|
||||
|
||||
!| Scenario | Detailed Diff Scenario Test |
|
||||
| start | Detailed Diff |
|
||||
| check | echo | hello | hello |
|
||||
| check | echo | hello | hallo |
|
||||
|
||||
!| Script |
|
||||
| Detailed Diff Scenario Test |
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
|
||||
Test Strings by plain compare, neither custom compare nor regular expression.
|
||||
In this case detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | abc | equal |
|
||||
| abc | xyz | completly different |
|
||||
| abc | xbc | first char different |
|
||||
| abc | ayc | middle char different |
|
||||
| abc | abz | last char different |
|
||||
| | xyz | actual empty, expected filled |
|
||||
| abc | | actual filled, expected empty; will be counted as ignored |
|
||||
| <&> | <&> | equal with HTML special chars |
|
||||
| <&> | xyz | completly different with HTML special chars |
|
||||
| <&> | x&> | first char different with HTML special chars |
|
||||
| <&> | <y> | middle char different with HTML special chars |
|
||||
| <&> | <&z | last char differentwith HTML special chars |
|
||||
| | <&> | actual empty, expected filled with HTML special chars |
|
||||
| abc | <&> | completly different with HTML special chars |
|
||||
| abc | <bc | first char different with HTML special chars |
|
||||
| abc | a&c | middle char different with HTML special chars |
|
||||
| abc | ab> | last char different with HTML special chars |
|
||||
| Hello World | Wellcome Lord | no obvious match |
|
||||
|
||||
Test Strings by regular expression.
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | =~/abc/ | match |
|
||||
| abc | =~/a.c/ | match |
|
||||
| abc | =~/\w+/ | match |
|
||||
| abc | =~/\w{3}/ | match |
|
||||
| abc | =~/^\w{3}$/ | match |
|
||||
| abc | =~/\w{1}/ | match |
|
||||
| abc | =~/^\w{1}$/ | no match |
|
||||
| abc | =~/[ABC]+/ | no match |
|
||||
| abc | =~/[ABC]+/i | wrong syntax, disable value comparison, use string comparison |
|
||||
|
||||
|
||||
Test integers by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | 1 | equal |
|
||||
| 1 | 2 | completly different |
|
||||
| 1 | 10 | partially different |
|
||||
| | 1 | completly different |
|
||||
|
||||
Test integers by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
|
||||
|
||||
Test doubles by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1.0 | 1.0 | equal |
|
||||
| 1.1 | 222 | completly different |
|
||||
| 1.0 | 10 | partially different |
|
||||
| | 1.0 | partially different |
|
||||
|
||||
Test doubles by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1.0 | ~=1 | ok |
|
||||
| 1.1 | ~=1 | ok |
|
||||
| 0.9 | ~=1 | ok |
|
||||
| 1.0 | ~=1.0 | ok |
|
||||
| 1.1 | ~=1.0 | nok |
|
||||
| 0.9 | ~=1.0 | nok |
|
||||
|
||||
|
||||
Test symbols by string comparison.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual symbol | expected symbol? | #comment |
|
||||
| abc | $symbol= | |
|
||||
| $symbol | abc | |
|
||||
| $symbol | xyz | |
|
||||
| $symbol | xbc | |
|
||||
| $symbol | ayc | |
|
||||
| $symbol | abz | |
|
||||
| abc | $symbol | |
|
||||
| xyz | $symbol | |
|
||||
| xbc | $symbol | |
|
||||
| ayc | $symbol | |
|
||||
| abz | $symbol | |
|
||||
| | $symbol | |
|
||||
|
||||
|
||||
Test custom comparator, see FitNesse.UserGuide.AdministeringFitNesse.ConfigurationFile
|
||||
The inverse comparator fitnesse.slim.test.InverseComparator negates the method String.equals(String).
|
||||
|
||||
| script | Detailed Diff |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:xyz |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:ABC |
|
||||
| note | everthing not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:cba |
|
||||
| note | only 'abc' is nok |
|
||||
| check | echo | abc | inverse:abc |
|
||||
|
||||
|
||||
Test Scenario and Script
|
||||
|
||||
!| Scenario | Detailed Diff Scenario Test |
|
||||
| start | Detailed Diff |
|
||||
| check | echo | hello | hello |
|
||||
| check | echo | hello | hallo |
|
||||
|
||||
!| Script |
|
||||
| Detailed Diff Scenario Test |
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<properties>
|
||||
<Edit/>
|
||||
<Files/>
|
||||
<Properties/>
|
||||
<Prune/>
|
||||
<RecentChanges/>
|
||||
<Refactor/>
|
||||
<Search/>
|
||||
<Test/>
|
||||
<Versions/>
|
||||
<WhereUsed/>
|
||||
</properties>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<properties>
|
||||
<Edit/>
|
||||
<Files/>
|
||||
<Properties/>
|
||||
<Prune/>
|
||||
<RecentChanges/>
|
||||
<Refactor/>
|
||||
<Search/>
|
||||
<Test/>
|
||||
<Versions/>
|
||||
<WhereUsed/>
|
||||
</properties>
|
||||
|
|
|
@ -1,230 +1,230 @@
|
|||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!3 Diff of failed tests
|
||||
|
||||
!4 Original intentionally failing tests
|
||||
|
||||
The subordinate page >TestPage collects the following tests. The page is disabled because of many tests fails intentionally. It is useful for manual tests only.
|
||||
|
||||
!4 Test wrapper for test
|
||||
|
||||
!*> Tests for type string
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
Test Strings by plain compare, neither custom compare nor regular expression.
|
||||
In this case detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | abc | equal |
|
||||
| abc | xyz | completly different |
|
||||
| abc | xbc | first char different |
|
||||
| abc | ayc | middle char different |
|
||||
| abc | abz | last char different |
|
||||
| | xyz | actual empty, expected filled |
|
||||
| abc | | actual filled, expected empty; will be counted as ignored |
|
||||
| <&> | <&> | equal with HTML special chars |
|
||||
| <&> | xyz | completly different with HTML special chars |
|
||||
| <&> | x&> | first char different with HTML special chars |
|
||||
| <&> | <y> | middle char different with HTML special chars |
|
||||
| <&> | <&z | last char differentwith HTML special chars |
|
||||
| | <&> | actual empty, expected filled with HTML special chars |
|
||||
| abc | <&> | completly different with HTML special chars |
|
||||
| abc | <bc | first char different with HTML special chars |
|
||||
| abc | a&c | middle char different with HTML special chars |
|
||||
| abc | ab> | last char different with HTML special chars |
|
||||
| Hello World | Wellcome Lord | no obvious match |
|
||||
|
||||
Test Strings by regular expression.
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | =~/abc/ | match |
|
||||
| abc | =~/a.c/ | match |
|
||||
| abc | =~/\w+/ | match |
|
||||
| abc | =~/\w{3}/ | match |
|
||||
| abc | =~/^\w{3}$/ | match |
|
||||
| abc | =~/\w{1}/ | match |
|
||||
| abc | =~/^\w{1}$/ | no match |
|
||||
| abc | =~/[ABC]+/ | no match |
|
||||
| abc | =~/[ABC]+/i | wrong syntax, disable value comparison, use string comparison |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">abc</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">abc</span>] <span class="fail">expected [</span><span class="diff">xyz</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">a</span>bc] <span class="fail">expected [</span><span class="diff">x</span><span class="fail">bc]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[a<span class="diff">b</span>c] <span class="fail">expected [a</span><span class="diff">y</span><span class="fail">c]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[ab<span class="diff">c</span>] <span class="fail">expected [ab</span><span class="diff">z</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[] <span class="fail">expected [</span><span class="diff">xyz</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">H</span>ello <span class="diff">W</span>or<span class="diff">l</span>d] <span class="fail">expected [</span><span class="diff">W</span><span class="fail">ell</span><span class="diff">c</span><span class="fail">o</span><span class="diff">me</span><span class="fail"> </span><span class="diff">L</span><span class="fail">ord]-!|
|
||||
*!
|
||||
|
||||
!*> Tests for type int
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
Test integers by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | 1 | equal |
|
||||
| 1 | 2 | completly different |
|
||||
| 1 | 10 | partially different |
|
||||
| | 1 | completly different |
|
||||
|
||||
Test integers by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain||
|
||||
*!
|
||||
|
||||
!*> Tests for type double
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
Test doubles by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1.0 | 1.0 | equal |
|
||||
| 1.1 | 222 | completly different |
|
||||
| 1.0 | 10 | partially different |
|
||||
| | 1.0 | partially different |
|
||||
|
||||
Test doubles by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1.0 | ~=1 | ok |
|
||||
| 1.1 | ~=1 | ok |
|
||||
| 0.9 | ~=1 | ok |
|
||||
| 1.0 | ~=1.0 | ok |
|
||||
| 1.1 | ~=1.0 | nok |
|
||||
| 0.9 | ~=1.0 | nok |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain||
|
||||
*!
|
||||
|
||||
!*> Tests of fitnesse symbols
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
Test symbols by string comparison.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual symbol | expected symbol? | #comment |
|
||||
| abc | $symbol= | |
|
||||
| $symbol | abc | |
|
||||
| $symbol | xyz | |
|
||||
| $symbol | xbc | |
|
||||
| $symbol | ayc | |
|
||||
| $symbol | abz | |
|
||||
| abc | $symbol | |
|
||||
| xyz | $symbol | |
|
||||
| xbc | $symbol | |
|
||||
| ayc | $symbol | |
|
||||
| abz | $symbol | |
|
||||
| | $symbol | |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">abc</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">abc</span>] <span class="fail">expected [</span><span class="diff">xyz</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">a</span>bc] <span class="fail">expected [</span><span class="diff">x</span><span class="fail">bc]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[a<span class="diff">b</span>c] <span class="fail">expected [a</span><span class="diff">y</span><span class="fail">c]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[ab<span class="diff">c</span>] <span class="fail">expected [ab</span><span class="diff">z</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">$symbol->[abc]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">xyz</span>] <span class="fail">expected [$symbol->[</span><span class="diff">abc</span><span class="fail">]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">x</span>bc] <span class="fail">expected [$symbol->[</span><span class="diff">a</span><span class="fail">bc]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[a<span class="diff">y</span>c] <span class="fail">expected [$symbol->[a</span><span class="diff">b</span><span class="fail">c]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[ab<span class="diff">z</span>] <span class="fail">expected [$symbol->[ab</span><span class="diff">c</span><span class="fail">]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[] <span class="fail">expected [$symbol->[</span><span class="diff">abc</span><span class="fail">]]</span>-!|
|
||||
*!
|
||||
|
||||
!*> Tests of custom comparator
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
Test custom comparator, see FitNesse.UserGuide.AdministeringFitNesse.ConfigurationFile
|
||||
The inverse comparator fitnesse.slim.test.InverseComparator negates the method String.equals(String).
|
||||
|
||||
| script | Detailed Diff |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:xyz |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:ABC |
|
||||
| note | everthing not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:cba |
|
||||
| note | only 'abc' is nok |
|
||||
| check | echo | abc | inverse:abc |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain||
|
||||
*!
|
||||
|
||||
!*> Tests of scenario
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
Test Scenario and Script
|
||||
|
||||
!| Scenario | Detailed Diff Scenario Test |
|
||||
| start | Detailed Diff |
|
||||
| check | echo | hello | hello |
|
||||
| check | echo | hello | hallo |
|
||||
|
||||
!| Script |
|
||||
| Detailed Diff Scenario Test |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">hello</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[h<span class="diff">e</span>llo] <span class="fail">expected [h</span><span class="diff">a</span><span class="fail">llo]</span>-!|
|
||||
*!
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!3 Diff of failed tests
|
||||
|
||||
!4 Original intentionally failing tests
|
||||
|
||||
The subordinate page >TestPage collects the following tests. The page is disabled because of many tests fails intentionally. It is useful for manual tests only.
|
||||
|
||||
!4 Test wrapper for test
|
||||
|
||||
!*> Tests for type string
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
Test Strings by plain compare, neither custom compare nor regular expression.
|
||||
In this case detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | abc | equal |
|
||||
| abc | xyz | completly different |
|
||||
| abc | xbc | first char different |
|
||||
| abc | ayc | middle char different |
|
||||
| abc | abz | last char different |
|
||||
| | xyz | actual empty, expected filled |
|
||||
| abc | | actual filled, expected empty; will be counted as ignored |
|
||||
| <&> | <&> | equal with HTML special chars |
|
||||
| <&> | xyz | completly different with HTML special chars |
|
||||
| <&> | x&> | first char different with HTML special chars |
|
||||
| <&> | <y> | middle char different with HTML special chars |
|
||||
| <&> | <&z | last char differentwith HTML special chars |
|
||||
| | <&> | actual empty, expected filled with HTML special chars |
|
||||
| abc | <&> | completly different with HTML special chars |
|
||||
| abc | <bc | first char different with HTML special chars |
|
||||
| abc | a&c | middle char different with HTML special chars |
|
||||
| abc | ab> | last char different with HTML special chars |
|
||||
| Hello World | Wellcome Lord | no obvious match |
|
||||
|
||||
Test Strings by regular expression.
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual string | expected string? | #comment |
|
||||
| abc | =~/abc/ | match |
|
||||
| abc | =~/a.c/ | match |
|
||||
| abc | =~/\w+/ | match |
|
||||
| abc | =~/\w{3}/ | match |
|
||||
| abc | =~/^\w{3}$/ | match |
|
||||
| abc | =~/\w{1}/ | match |
|
||||
| abc | =~/^\w{1}$/ | no match |
|
||||
| abc | =~/[ABC]+/ | no match |
|
||||
| abc | =~/[ABC]+/i | wrong syntax, disable value comparison, use string comparison |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">abc</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">abc</span>] <span class="fail">expected [</span><span class="diff">xyz</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">a</span>bc] <span class="fail">expected [</span><span class="diff">x</span><span class="fail">bc]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[a<span class="diff">b</span>c] <span class="fail">expected [a</span><span class="diff">y</span><span class="fail">c]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[ab<span class="diff">c</span>] <span class="fail">expected [ab</span><span class="diff">z</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[] <span class="fail">expected [</span><span class="diff">xyz</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">H</span>ello <span class="diff">W</span>or<span class="diff">l</span>d] <span class="fail">expected [</span><span class="diff">W</span><span class="fail">ell</span><span class="diff">c</span><span class="fail">o</span><span class="diff">me</span><span class="fail"> </span><span class="diff">L</span><span class="fail">ord]-!|
|
||||
*!
|
||||
|
||||
!*> Tests for type int
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
Test integers by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | 1 | equal |
|
||||
| 1 | 2 | completly different |
|
||||
| 1 | 10 | partially different |
|
||||
| | 1 | completly different |
|
||||
|
||||
Test integers by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual int | expected int? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain||
|
||||
*!
|
||||
|
||||
!*> Tests for type double
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
|
||||
Test doubles by string comparison.
|
||||
In this case detailed diff ist wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1.0 | 1.0 | equal |
|
||||
| 1.1 | 222 | completly different |
|
||||
| 1.0 | 10 | partially different |
|
||||
| | 1.0 | partially different |
|
||||
|
||||
Test doubles by value comparison, see <FitNesse.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
|
||||
In this case no detailed diff is wanted.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual double | expected double? | #comment |
|
||||
| 1 | >=1 | ok |
|
||||
| 1 | <2 | ok |
|
||||
| 1 | >1 | nok |
|
||||
| 1 | =1 | ok |
|
||||
| 1 | <1 | nok |
|
||||
| 1 | 0<_<2 | ok |
|
||||
| 1 | 2<_<0 | nok, logically wrong |
|
||||
| 1 | 0>_>2 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1 | 2>_>0 | wrong syntax, disable value comparison, use string comparison |
|
||||
| 1.0 | ~=1 | ok |
|
||||
| 1.1 | ~=1 | ok |
|
||||
| 0.9 | ~=1 | ok |
|
||||
| 1.0 | ~=1.0 | ok |
|
||||
| 1.1 | ~=1.0 | nok |
|
||||
| 0.9 | ~=1.0 | nok |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain||
|
||||
*!
|
||||
|
||||
!*> Tests of fitnesse symbols
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
Test symbols by string comparison.
|
||||
|
||||
| Detailed Diff |
|
||||
| actual symbol | expected symbol? | #comment |
|
||||
| abc | $symbol= | |
|
||||
| $symbol | abc | |
|
||||
| $symbol | xyz | |
|
||||
| $symbol | xbc | |
|
||||
| $symbol | ayc | |
|
||||
| $symbol | abz | |
|
||||
| abc | $symbol | |
|
||||
| xyz | $symbol | |
|
||||
| xbc | $symbol | |
|
||||
| ayc | $symbol | |
|
||||
| abz | $symbol | |
|
||||
| | $symbol | |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">abc</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">abc</span>] <span class="fail">expected [</span><span class="diff">xyz</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">a</span>bc] <span class="fail">expected [</span><span class="diff">x</span><span class="fail">bc]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[a<span class="diff">b</span>c] <span class="fail">expected [a</span><span class="diff">y</span><span class="fail">c]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[ab<span class="diff">c</span>] <span class="fail">expected [ab</span><span class="diff">z</span><span class="fail">]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">$symbol->[abc]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">xyz</span>] <span class="fail">expected [$symbol->[</span><span class="diff">abc</span><span class="fail">]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[<span class="diff">x</span>bc] <span class="fail">expected [$symbol->[</span><span class="diff">a</span><span class="fail">bc]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[a<span class="diff">y</span>c] <span class="fail">expected [$symbol->[a</span><span class="diff">b</span><span class="fail">c]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[ab<span class="diff">z</span>] <span class="fail">expected [$symbol->[ab</span><span class="diff">c</span><span class="fail">]]</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[] <span class="fail">expected [$symbol->[</span><span class="diff">abc</span><span class="fail">]]</span>-!|
|
||||
*!
|
||||
|
||||
!*> Tests of custom comparator
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
Test custom comparator, see FitNesse.UserGuide.AdministeringFitNesse.ConfigurationFile
|
||||
The inverse comparator fitnesse.slim.test.InverseComparator negates the method String.equals(String).
|
||||
|
||||
| script | Detailed Diff |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:xyz |
|
||||
| note | everything not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:ABC |
|
||||
| note | everthing not equals to 'abc' is ok |
|
||||
| check | echo | abc | inverse:cba |
|
||||
| note | only 'abc' is nok |
|
||||
| check | echo | abc | inverse:abc |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain||
|
||||
*!
|
||||
|
||||
!*> Tests of scenario
|
||||
|
||||
!| script |
|
||||
|given page|TestPage|with content|${SUT_PATH} !-
|
||||
!define TEST_SYSTEM {slim}
|
||||
|
||||
!| import |
|
||||
| fitnesse.slim.test |
|
||||
Test Scenario and Script
|
||||
|
||||
!| Scenario | Detailed Diff Scenario Test |
|
||||
| start | Detailed Diff |
|
||||
| check | echo | hello | hello |
|
||||
| check | echo | hello | hallo |
|
||||
|
||||
!| Script |
|
||||
| Detailed Diff Scenario Test |
|
||||
-!|
|
||||
|test results for page|TestPage|should contain|!-<span class="pass">hello</span>-!|
|
||||
|test results for page|TestPage|should contain|!-[h<span class="diff">e</span>llo] <span class="fail">expected [h</span><span class="diff">a</span><span class="fail">llo]</span>-!|
|
||||
*!
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Test>true</Test>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
</properties>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Test>true</Test>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
</properties>
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
|import |
|
||||
|fitnesse.slim.test|
|
||||
|
||||
|
||||
There was a bug in the Scenario selection process that caused a scenario with no inputs to be selected when it should have been method on the driver class. This happened because the !-ScenarioTable-! class was enhanced to try all rows as parameterized. So it took "login" and tried "login _ ". This resulted in the "login" scenario being used instead of the "loginWithUsernameAndPassword" method when "connect as with" scenario was called. This page demonstrates the fix.
|
||||
|
||||
|
||||
!2 Scenario with no arguments and a shared root
|
||||
!|scenario |login |
|
||||
|connect to server|
|
||||
|
||||
!2
|
||||
!|scenario |connect as|username |with|password|
|
||||
|login with username|@username |and Password|@password |
|
||||
|
||||
|
||||
!2 Scenario With one argument and a shared root.
|
||||
!|scenario |login with|name|
|
||||
|connect to server as|@name |
|
||||
|
||||
|
||||
!2 Now calling a scenario that does take arguments, but since it isn't in parameterized format, the scenario with an argument isn't called, even though it shares a common root.
|
||||
!|scenario |connect as|username |with|password|
|
||||
|login with username|@username |and Password|@password |
|
||||
|
||||
|
||||
|
||||
|
||||
!|script |
|
||||
|start |Login Dialog Driver|bob |xyzz|
|
||||
|connect as|bob |with|xyzz|
|
||||
|
||||
|
||||
|import |
|
||||
|fitnesse.slim.test|
|
||||
|
||||
|
||||
There was a bug in the Scenario selection process that caused a scenario with no inputs to be selected when it should have been method on the driver class. This happened because the !-ScenarioTable-! class was enhanced to try all rows as parameterized. So it took "login" and tried "login _ ". This resulted in the "login" scenario being used instead of the "loginWithUsernameAndPassword" method when "connect as with" scenario was called. This page demonstrates the fix.
|
||||
|
||||
|
||||
!2 Scenario with no arguments and a shared root
|
||||
!|scenario |login |
|
||||
|connect to server|
|
||||
|
||||
!2
|
||||
!|scenario |connect as|username |with|password|
|
||||
|login with username|@username |and Password|@password |
|
||||
|
||||
|
||||
!2 Scenario With one argument and a shared root.
|
||||
!|scenario |login with|name|
|
||||
|connect to server as|@name |
|
||||
|
||||
|
||||
!2 Now calling a scenario that does take arguments, but since it isn't in parameterized format, the scenario with an argument isn't called, even though it shares a common root.
|
||||
!|scenario |connect as|username |with|password|
|
||||
|login with username|@username |and Password|@password |
|
||||
|
||||
|
||||
|
||||
|
||||
!|script |
|
||||
|start |Login Dialog Driver|bob |xyzz|
|
||||
|connect as|bob |with|xyzz|
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Test>true</Test>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Test>true</Test>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
</properties>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
Create an absolute symbolic link from a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkingChild|LINKING CHILD |true |
|
||||
|LinkedPage |LINKED PAGE |true |
|
||||
|LinkedPage.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage.LinkedChild-! as a child of !-LinkingPage.LinkingChild-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage.LinkingChild?responder=symlink&linkName=SymLink&linkPath=.LinkedPage.LinkedChild|303|
|
||||
Create an absolute symbolic link from a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkingChild|LINKING CHILD |true |
|
||||
|LinkedPage |LINKED PAGE |true |
|
||||
|LinkedPage.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage.LinkedChild-! as a child of !-LinkingPage.LinkingChild-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage.LinkingChild?responder=symlink&linkName=SymLink&linkPath=.LinkedPage.LinkedChild|303|
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071209231745</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197255276583</saveId>
|
||||
<ticketId>-2802271540647210678</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071209231745</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197255276583</saveId>
|
||||
<ticketId>-2802271540647210678</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
Create an absolute symbolic link from a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkingChild|LINKING CHILD |true |
|
||||
|LinkingPage.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage.LinkedChild-! as a child of !-LinkingPage.LinkingChild-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage.LinkingChild?responder=symlink&linkName=SymLink&linkPath=<LinkingPage.LinkedChild|303|
|
||||
Create an absolute symbolic link from a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkingChild|LINKING CHILD |true |
|
||||
|LinkingPage.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage.LinkedChild-! as a child of !-LinkingPage.LinkingChild-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage.LinkingChild?responder=symlink&linkName=SymLink&linkPath=<LinkingPage.LinkedChild|303|
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071209231818</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197255523311</saveId>
|
||||
<ticketId>-2905294764201163185</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071209231818</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197255523311</saveId>
|
||||
<ticketId>-2905294764201163185</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
Create an nested backward symbolic link from a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkingChild |LINKING CHILD |true |
|
||||
|LinkingPage.LinkingChild.LinkingGrandChild |LINKING GRAND CHILD |true |
|
||||
|LinkingPage.LinkingChild.LinkingGrandChild.LinkingGreatGrandChild|LINKING GREAT GRAND CHILD |true |
|
||||
|LinkingPage.LinkingChild.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage.LinkedChild-! as a child of !-LinkingPage.LinkingChild-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage.LinkingChild.LinkingGrandChild.LinkingGreatGrandChild?responder=symlink&linkName=SymLink&linkPath=<LinkingChild.LinkedChild|303|
|
||||
Create an nested backward symbolic link from a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkingChild |LINKING CHILD |true |
|
||||
|LinkingPage.LinkingChild.LinkingGrandChild |LINKING GRAND CHILD |true |
|
||||
|LinkingPage.LinkingChild.LinkingGrandChild.LinkingGreatGrandChild|LINKING GREAT GRAND CHILD |true |
|
||||
|LinkingPage.LinkingChild.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage.LinkedChild-! as a child of !-LinkingPage.LinkingChild-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage.LinkingChild.LinkingGrandChild.LinkingGreatGrandChild?responder=symlink&linkName=SymLink&linkPath=<LinkingChild.LinkedChild|303|
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071212153458</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197318232254</saveId>
|
||||
<ticketId>-6614712250920689672</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071212153458</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197318232254</saveId>
|
||||
<ticketId>-6614712250920689672</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
Creating a symbolic link is done in the properties view of the page that will contain the link. There is a form where a user supplies a name for the link and a path for the linked page. When submitted the URL has the following form:
|
||||
|
||||
!-http://host/PathToPage?responder=symlink&linkName=<linkName>&linkPath=<linkPath>-!
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name.|valid?|
|
||||
|LinkingPage|true|
|
||||
|LinkedPage|true|
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage-! as a child of !-LinkingPage-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage?responder=symlink&linkName=SymLink&linkPath=LinkedPage|303|
|
||||
|
||||
Creating a symbolic link is done in the properties view of the page that will contain the link. There is a form where a user supplies a name for the link and a path for the linked page. When submitted the URL has the following form:
|
||||
|
||||
!-http://host/PathToPage?responder=symlink&linkName=<linkName>&linkPath=<linkPath>-!
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name.|valid?|
|
||||
|LinkingPage|true|
|
||||
|LinkedPage|true|
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkedPage-! as a child of !-LinkingPage-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage?responder=symlink&linkName=SymLink&linkPath=LinkedPage|303|
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071209231838</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197229524174</saveId>
|
||||
<ticketId>5360217332855886973</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help></Help>
|
||||
<LastModified>20071209231838</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<saveId>1197229524174</saveId>
|
||||
<ticketId>5360217332855886973</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
Create a symbolic link to a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkingPage.LinkedChild-! as a child of !-LinkingPage-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage?responder=symlink&linkName=SymLink&linkPath=>LinkedChild|303|
|
||||
Create a symbolic link to a sub-page:
|
||||
|
||||
First we need to create some pages to play with.
|
||||
!|Page creator.|
|
||||
|Page name. |PageContents. |valid?|
|
||||
|LinkingPage |LINKING PAGE |true |
|
||||
|LinkingPage.LinkedChild |LINKED CHILD |true |
|
||||
|
||||
Now we create a symbolic link named !-SymLink-!. This links !-LinkingPage.LinkedChild-! as a child of !-LinkingPage-!.
|
||||
!|Response Requester.|
|
||||
|uri |status?|
|
||||
|LinkingPage?responder=symlink&linkName=SymLink&linkPath=>LinkedChild|303|
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<LastModified>20071209210332</LastModified>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
<saveId>1197252212825</saveId>
|
||||
<ticketId>6202123951021509855</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Edit>true</Edit>
|
||||
<Files>true</Files>
|
||||
<LastModified>20071209210332</LastModified>
|
||||
<Properties>true</Properties>
|
||||
<RecentChanges>true</RecentChanges>
|
||||
<Refactor>true</Refactor>
|
||||
<Search>true</Search>
|
||||
<Versions>true</Versions>
|
||||
<WhereUsed>true</WhereUsed>
|
||||
<saveId>1197252212825</saveId>
|
||||
<ticketId>6202123951021509855</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
!c !3 Symbolic Links
|
||||
|
||||
Symbolic Links allow a user to easily create parent-child links between pages without permanently affecting the wiki structure. One common reason need for Symbolic Links is the the testing of a system on multiple environments. For example, imagine an application that site on top of an Oracle database. Hundreds of FitNesse tests have been written for this application using Oracle settings and then the team is confronted with the need to run the application on !-MySql-!. Getting both databases running under the same suite of tests can be very difficult and may result in duplicating all the tests. With Symbolic Links, the database configurations can be stored in high level pages along with appropriate path elements. Then the high-level pages may symbolically link to the test suite. In this manner one suite of tests can be executed in multiple environments.
|
||||
|
||||
|
||||
>TestCreatingRelativeSymbolicLink
|
||||
>TestCreatingAbsoluteSymbolicLink
|
||||
>TestCreatingSubPageSymbolicLink
|
||||
>TestCreatingBackwardSymbolicLink
|
||||
>TestRemovingSymbolicLink
|
||||
>TestSymbolicLinkBehavior
|
||||
----
|
||||
All Subpages:
|
||||
!c !3 Symbolic Links
|
||||
|
||||
Symbolic Links allow a user to easily create parent-child links between pages without permanently affecting the wiki structure. One common reason need for Symbolic Links is the the testing of a system on multiple environments. For example, imagine an application that site on top of an Oracle database. Hundreds of FitNesse tests have been written for this application using Oracle settings and then the team is confronted with the need to run the application on !-MySql-!. Getting both databases running under the same suite of tests can be very difficult and may result in duplicating all the tests. With Symbolic Links, the database configurations can be stored in high level pages along with appropriate path elements. Then the high-level pages may symbolically link to the test suite. In this manner one suite of tests can be executed in multiple environments.
|
||||
|
||||
|
||||
>TestCreatingRelativeSymbolicLink
|
||||
>TestCreatingAbsoluteSymbolicLink
|
||||
>TestCreatingSubPageSymbolicLink
|
||||
>TestCreatingBackwardSymbolicLink
|
||||
>TestRemovingSymbolicLink
|
||||
>TestSymbolicLinkBehavior
|
||||
----
|
||||
All Subpages:
|
||||
!contents
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help/>
|
||||
<LastModified>20071209232537</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suite/>
|
||||
<Suites/>
|
||||
<WhereUsed/>
|
||||
<saveId>1197260737340</saveId>
|
||||
<ticketId>159061011507139978</ticketId>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<Help/>
|
||||
<LastModified>20071209232537</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suite/>
|
||||
<Suites/>
|
||||
<WhereUsed/>
|
||||
<saveId>1197260737340</saveId>
|
||||
<ticketId>159061011507139978</ticketId>
|
||||
</properties>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<LastModified>20071130010014</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<Test/>
|
||||
<WhereUsed/>
|
||||
</properties>
|
||||
<?xml version="1.0"?>
|
||||
<properties>
|
||||
<Files/>
|
||||
<LastModified>20071130010014</LastModified>
|
||||
<RecentChanges/>
|
||||
<Suites></Suites>
|
||||
<Test/>
|
||||
<WhereUsed/>
|
||||
</properties>
|
||||
|
|
145
pom.xml
145
pom.xml
|
@ -1,7 +1,6 @@
|
|||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -9,24 +8,17 @@
|
|||
<artifactId>transcendental-lisp</artifactId>
|
||||
<version>1.2.0</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<kotlin.version>1.2.30</kotlin.version>
|
||||
<junit5.version>5.1.0</junit5.version>
|
||||
<skipTests>false</skipTests>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<testSourceDirectory>test</testSourceDirectory>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>lisp/lang</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<testResources>
|
||||
<testResource>
|
||||
<directory>test</directory>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
</testResource>
|
||||
</testResources>
|
||||
<!-- TODO - when everything is converted to kotlin -->
|
||||
<!--<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>-->
|
||||
<!--<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>-->
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -41,10 +33,62 @@
|
|||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<jvmTarget>1.8</jvmTarget>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- TODO - remove when everything is converted to kotlin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<executions>
|
||||
<!-- Replacing default-compile as it is treated specially by maven -->
|
||||
<execution>
|
||||
<id>default-compile</id>
|
||||
<phase>none</phase>
|
||||
</execution>
|
||||
<!-- Replacing default-testCompile as it is treated specially by maven -->
|
||||
<execution>
|
||||
<id>default-testCompile</id>
|
||||
<phase>none</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>java-compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>java-test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
|
@ -54,7 +98,29 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<version>2.19.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-surefire-provider</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TODO - remove when all test cases converted to junit 5 -->
|
||||
<dependency>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<skipTests>${skipTests}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
|
@ -84,7 +150,7 @@
|
|||
<configuration>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>main.LispMain</mainClass>
|
||||
<mainClass>application.LispMain</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
|
@ -95,12 +161,40 @@
|
|||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.googlecode.lanterna</groupId>
|
||||
<artifactId>lanterna</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.9.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<version>${junit5.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- TODO - remove when test cases all converted to junit 5 and assertj-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
|
@ -108,6 +202,7 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- TODO - remove when test cases all converted to junit 5 and assertj-->
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-all</artifactId>
|
||||
|
@ -130,8 +225,4 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,21 +0,0 @@
|
|||
package error;
|
||||
|
||||
import static error.ErrorManager.Severity.CRITICAL;
|
||||
|
||||
import error.ErrorManager.Severity;
|
||||
import file.FilePosition;
|
||||
|
||||
public abstract class CriticalLineColumnException extends LineColumnException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CriticalLineColumnException(FilePosition position) {
|
||||
super(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Severity getSeverity() {
|
||||
return CRITICAL;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package error;
|
||||
|
||||
import static error.ErrorManager.Severity.CRITICAL;
|
||||
|
||||
import error.ErrorManager.Severity;
|
||||
|
||||
public abstract class CriticalLispException extends LispException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public Severity getSeverity() {
|
||||
return CRITICAL;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
package error;
|
||||
|
||||
import static error.ErrorManager.Severity.CRITICAL;
|
||||
import static error.ErrorManager.Severity.WARNING;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
import environment.RuntimeEnvironment;
|
||||
|
||||
/**
|
||||
* Prints error messages and potentially terminates the application.
|
||||
*/
|
||||
public class ErrorManager {
|
||||
|
||||
private RuntimeEnvironment environment;
|
||||
|
||||
public ErrorManager() {
|
||||
this.environment = RuntimeEnvironment.getInstance();
|
||||
}
|
||||
|
||||
public void handle(LispException lispException) {
|
||||
printMessage(lispException);
|
||||
|
||||
if (isCritical(lispException))
|
||||
environment.terminateExceptionally();
|
||||
}
|
||||
|
||||
private void printMessage(LispException lispException) {
|
||||
PrintStream output = selectOutputStream(lispException.getSeverity());
|
||||
output.println(formatMessage(lispException));
|
||||
}
|
||||
|
||||
private PrintStream selectOutputStream(Severity severity) {
|
||||
if (severity == WARNING)
|
||||
return environment.getOutput();
|
||||
|
||||
return environment.getErrorOutput();
|
||||
}
|
||||
|
||||
private String formatMessage(LispException lispException) {
|
||||
Severity severity = lispException.getSeverity();
|
||||
String prefix = severity.toDisplayString();
|
||||
String message = format("[{0}] {1}", prefix, lispException.getMessage());
|
||||
|
||||
return severity.decorate(message, environment);
|
||||
}
|
||||
|
||||
private boolean isCritical(LispException lispException) {
|
||||
return lispException.getSeverity() == CRITICAL;
|
||||
}
|
||||
|
||||
public static enum Severity {
|
||||
|
||||
WARNING {
|
||||
|
||||
@Override
|
||||
public String decorate(String warningOutput, RuntimeEnvironment environment) {
|
||||
return environment.decorateWarningOutput(warningOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toDisplayString() {
|
||||
return "warning";
|
||||
}
|
||||
},
|
||||
|
||||
ERROR {
|
||||
|
||||
@Override
|
||||
public String decorate(String errorOutput, RuntimeEnvironment environment) {
|
||||
return environment.decorateErrorOutput(errorOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toDisplayString() {
|
||||
return "error";
|
||||
}
|
||||
},
|
||||
|
||||
CRITICAL {
|
||||
|
||||
@Override
|
||||
public String decorate(String criticalOutput, RuntimeEnvironment environment) {
|
||||
return environment.decorateCriticalOutput(criticalOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toDisplayString() {
|
||||
return "critical";
|
||||
}
|
||||
};
|
||||
|
||||
public abstract String decorate(String output, RuntimeEnvironment environment);
|
||||
|
||||
public abstract String toDisplayString();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package error;
|
||||
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
import file.FilePosition;
|
||||
|
||||
public abstract class LineColumnException extends LispException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private FilePosition position;
|
||||
|
||||
public LineColumnException(FilePosition position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return format("{0} - line {1}, column {2}",
|
||||
getMessagePrefix(),
|
||||
position.getLineNumber(),
|
||||
position.getColumnNumber());
|
||||
}
|
||||
|
||||
public abstract String getMessagePrefix();
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package error;
|
||||
|
||||
import static error.ErrorManager.Severity.ERROR;
|
||||
|
||||
import error.ErrorManager.Severity;
|
||||
|
||||
public abstract class LispException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Severity getSeverity() {
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package error;
|
||||
|
||||
import static error.ErrorManager.Severity.WARNING;
|
||||
|
||||
import error.ErrorManager.Severity;
|
||||
|
||||
public abstract class LispWarning extends LispException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public Severity getSeverity() {
|
||||
return WARNING;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package function.builtin.special;
|
||||
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispSpecialFunction;
|
||||
import function.UserDefinedFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.LambdaExpression;
|
||||
import sexpression.SExpression;
|
||||
import sexpression.Symbol;
|
||||
|
||||
@FunctionNames({ "LAMBDA", "Λ" })
|
||||
public class LAMBDA extends LispSpecialFunction {
|
||||
|
||||
public static boolean isLambdaExpression(SExpression sexpr) {
|
||||
if (sexpr.isCons()) {
|
||||
String first = ((Cons) sexpr).getFirst().toString();
|
||||
|
||||
return "LAMBDA".equals(first) || "Λ".equals(first);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static UserDefinedFunction createFunction(Cons lambdaExpression) {
|
||||
SExpression rest = lambdaExpression.getRest();
|
||||
|
||||
ArgumentValidator lambdaValidator = new ArgumentValidator("LAMBDA|create|");
|
||||
lambdaValidator.setEveryArgumentExpectedType(Cons.class);
|
||||
lambdaValidator.validate(makeList(rest));
|
||||
|
||||
LambdaExpression lambda = new LAMBDA("LAMBDA").call((Cons) rest);
|
||||
|
||||
return lambda.getFunction();
|
||||
}
|
||||
|
||||
private ArgumentValidator argumentValidator;
|
||||
private ArgumentValidator lambdaListValidator;
|
||||
|
||||
public LAMBDA(String name) {
|
||||
this.argumentValidator = new ArgumentValidator(name);
|
||||
this.argumentValidator.setFirstArgumentExpectedType(Cons.class);
|
||||
this.argumentValidator.setMinimumNumberOfArguments(1);
|
||||
|
||||
this.lambdaListValidator = new ArgumentValidator(name + "|lambda-list|");
|
||||
this.lambdaListValidator.setEveryArgumentExpectedType(Symbol.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LambdaExpression call(Cons argumentList) {
|
||||
argumentValidator.validate(argumentList);
|
||||
|
||||
SExpression first = argumentList.getFirst();
|
||||
Cons lambdaList = (Cons) first;
|
||||
Cons body = (Cons) argumentList.getRest();
|
||||
|
||||
lambdaListValidator.validate(lambdaList);
|
||||
|
||||
UserDefinedFunction function = new UserDefinedFunction(":LAMBDA", lambdaList, body);
|
||||
|
||||
return new LambdaExpression(makeOriginalLambdaExpression(argumentList), function);
|
||||
}
|
||||
|
||||
private Cons makeOriginalLambdaExpression(Cons argumentList) {
|
||||
return new Cons(new Symbol("LAMBDA"), argumentList);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,14 @@
|
|||
package main;
|
||||
package application;
|
||||
|
||||
import static com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static terminal.LispTerminal.END_OF_SEGMENT;
|
||||
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
|
||||
import com.googlecode.lanterna.terminal.IOSafeTerminal;
|
||||
import com.googlecode.lanterna.terminal.Terminal;
|
||||
import interpreter.LispInterpreter;
|
||||
import interpreter.LispInterpreterBuilder;
|
||||
import interpreter.LispInterpreterBuilderImpl;
|
||||
import stream.UncheckedIOException;
|
||||
import terminal.LispTerminal;
|
||||
import terminal.TerminalConfiguration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PipedInputStream;
|
||||
|
@ -10,16 +16,9 @@ import java.io.PipedOutputStream;
|
|||
import java.io.PrintStream;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
|
||||
import com.googlecode.lanterna.terminal.IOSafeTerminal;
|
||||
import com.googlecode.lanterna.terminal.Terminal;
|
||||
|
||||
import interpreter.LispInterpreter;
|
||||
import interpreter.LispInterpreterBuilder;
|
||||
import interpreter.LispInterpreterBuilderImpl;
|
||||
import stream.UncheckedIOException;
|
||||
import terminal.LispTerminal;
|
||||
import terminal.TerminalConfiguration;
|
||||
import static com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static terminal.LispTerminal.END_OF_SEGMENT;
|
||||
|
||||
public class LispMain {
|
||||
|
||||
|
@ -152,5 +151,4 @@ public class LispMain {
|
|||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package environment;
|
||||
|
||||
import error.ErrorManager;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.util.function.Function;
|
||||
|
||||
import error.ErrorManager;
|
||||
|
||||
public class RuntimeEnvironment {
|
||||
|
||||
private static RuntimeEnvironment uniqueInstance = new RuntimeEnvironment();
|
||||
|
@ -151,5 +151,4 @@ public class RuntimeEnvironment {
|
|||
public String decorateCriticalOutput(String criticalOutput) {
|
||||
return criticalOutputDecorator.apply(criticalOutput);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package error
|
||||
|
||||
import error.Severity.CRITICAL
|
||||
import file.FilePosition
|
||||
|
||||
abstract class CriticalLineColumnException(position: FilePosition) : LineColumnException(position) {
|
||||
|
||||
override val severity = CRITICAL
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package error
|
||||
|
||||
import error.Severity.CRITICAL
|
||||
|
||||
abstract class CriticalLispException : LispException() {
|
||||
|
||||
override val severity = CRITICAL
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package error
|
||||
|
||||
import environment.RuntimeEnvironment
|
||||
import error.Severity.CRITICAL
|
||||
import error.Severity.WARNING
|
||||
import java.io.PrintStream
|
||||
import java.text.MessageFormat.format
|
||||
|
||||
/**
|
||||
* Prints error messages and potentially terminates the application.
|
||||
*/
|
||||
class ErrorManager {
|
||||
|
||||
private val environment: RuntimeEnvironment = RuntimeEnvironment.getInstance()
|
||||
|
||||
fun handle(lispException: LispException) {
|
||||
printMessage(lispException)
|
||||
|
||||
if (isCritical(lispException))
|
||||
environment.terminateExceptionally()
|
||||
}
|
||||
|
||||
private fun printMessage(lispException: LispException) {
|
||||
val output = selectOutputStream(lispException.severity)
|
||||
output.println(formatMessage(lispException))
|
||||
}
|
||||
|
||||
private fun selectOutputStream(severity: Severity): PrintStream {
|
||||
return if (severity === WARNING) environment.output else environment.errorOutput
|
||||
}
|
||||
|
||||
private fun formatMessage(lispException: LispException): String {
|
||||
val severity = lispException.severity
|
||||
val prefix = severity.toDisplayString()
|
||||
val message = format("[{0}] {1}", prefix, lispException.message)
|
||||
|
||||
return severity.decorate(message, environment)
|
||||
}
|
||||
|
||||
private fun isCritical(lispException: LispException) = lispException.severity == CRITICAL
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package error
|
||||
|
||||
import file.FilePosition
|
||||
import java.text.MessageFormat.format
|
||||
|
||||
abstract class LineColumnException(private val position: FilePosition) : LispException() {
|
||||
|
||||
abstract val messagePrefix: String
|
||||
|
||||
override val message: String
|
||||
get() = format("{0} - line {1}, column {2}", messagePrefix, position.lineNumber, position.columnNumber)
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package error
|
||||
|
||||
import error.Severity.ERROR
|
||||
|
||||
abstract class LispException : RuntimeException() {
|
||||
|
||||
open val severity = ERROR
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package error
|
||||
|
||||
import error.Severity.WARNING
|
||||
|
||||
abstract class LispWarning : LispException() {
|
||||
|
||||
override val severity = WARNING
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package error
|
||||
|
||||
import environment.RuntimeEnvironment
|
||||
|
||||
enum class Severity {
|
||||
|
||||
WARNING {
|
||||
override fun decorate(output: String, environment: RuntimeEnvironment): String =
|
||||
environment.decorateWarningOutput(output)
|
||||
|
||||
override fun toDisplayString() = "warning"
|
||||
},
|
||||
|
||||
ERROR {
|
||||
override fun decorate(output: String, environment: RuntimeEnvironment): String =
|
||||
environment.decorateErrorOutput(output)
|
||||
|
||||
override fun toDisplayString() = "error"
|
||||
},
|
||||
|
||||
CRITICAL {
|
||||
override fun decorate(output: String, environment: RuntimeEnvironment): String =
|
||||
environment.decorateCriticalOutput(output)
|
||||
|
||||
override fun toDisplayString() = "critical"
|
||||
};
|
||||
|
||||
abstract fun decorate(output: String, environment: RuntimeEnvironment): String
|
||||
|
||||
abstract fun toDisplayString(): String
|
||||
}
|
|
@ -29,5 +29,4 @@ public class FilePosition {
|
|||
public void setColumnNumber(int columnNumber) {
|
||||
this.columnNumber = columnNumber;
|
||||
}
|
||||
|
||||
}
|
|
@ -28,5 +28,4 @@ public class FilePositionTracker {
|
|||
lineNumber++;
|
||||
columnNumber = 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
package function;
|
||||
|
||||
import static function.builtin.cons.LENGTH.getLength;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import error.LispException;
|
||||
import sexpression.Cons;
|
||||
import sexpression.DisplayName;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import static function.builtin.cons.LENGTH.getLength;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
public class ArgumentValidator {
|
||||
|
||||
private Class<? extends SExpression> firstArgumentType;
|
||||
|
@ -231,5 +231,4 @@ public class ArgumentValidator {
|
|||
return (displayName == null) ? "unknown" : displayName.value();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -10,5 +10,4 @@ import java.lang.annotation.Target;
|
|||
public @interface FunctionNames {
|
||||
|
||||
String[] value();
|
||||
|
||||
}
|
|
@ -14,5 +14,4 @@ public abstract class LispFunction {
|
|||
public boolean isMacro() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,5 +6,4 @@ public abstract class LispSpecialFunction extends LispFunction {
|
|||
public boolean isArgumentListEvaluated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +1,5 @@
|
|||
package function;
|
||||
|
||||
import static function.builtin.EVAL.eval;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static recursion.TailCalls.done;
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import error.LispException;
|
||||
import recursion.TailCall;
|
||||
import recursion.TailCalls;
|
||||
|
@ -16,6 +9,13 @@ import sexpression.Symbol;
|
|||
import table.ExecutionContext;
|
||||
import table.SymbolTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static function.builtin.EVAL.eval;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static recursion.TailCalls.done;
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
public class UserDefinedFunction extends LispFunction {
|
||||
|
||||
private static final String KEYWORD_REST = "&REST";
|
||||
|
@ -166,5 +166,4 @@ public class UserDefinedFunction extends LispFunction {
|
|||
parameters);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -12,5 +12,4 @@ public class UserDefinedMacro extends UserDefinedSpecialFunction {
|
|||
public boolean isMacro() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -12,5 +12,4 @@ public class UserDefinedSpecialFunction extends UserDefinedFunction {
|
|||
public boolean isArgumentListEvaluated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
package function.builtin;
|
||||
|
||||
import static function.builtin.EVAL.applyFunction;
|
||||
import static function.builtin.EVAL.lookupFunctionOrLambda;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import static function.builtin.EVAL.applyFunction;
|
||||
import static function.builtin.EVAL.lookupFunctionOrLambda;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
@FunctionNames({ "APPLY" })
|
||||
public class APPLY extends LispFunction {
|
||||
|
||||
|
@ -36,5 +36,4 @@ public class APPLY extends LispFunction {
|
|||
|
||||
return applyFunction(function, functionArguments);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package function.builtin;
|
||||
|
||||
import static function.builtin.EVAL.eval;
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
import error.LispException;
|
||||
import function.ArgumentValidator;
|
||||
import sexpression.AtSignExpression;
|
||||
|
@ -11,6 +8,9 @@ import sexpression.CommaExpression;
|
|||
import sexpression.Cons;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import static function.builtin.EVAL.eval;
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
class BackquoteEvaluator {
|
||||
|
||||
private ArgumentValidator listValidator;
|
||||
|
@ -201,5 +201,4 @@ class BackquoteEvaluator {
|
|||
return "at sign did not evaluate to a list";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,17 +1,10 @@
|
|||
package function.builtin;
|
||||
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
import static function.builtin.special.LAMBDA.createFunction;
|
||||
import static function.builtin.special.LAMBDA.isLambdaExpression;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static sexpression.Nil.NIL;
|
||||
import static sexpression.Symbol.T;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
import error.LispException;
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import function.builtin.special.LAMBDA;
|
||||
import function.builtin.special.RECUR.RecurNotInTailPositionException;
|
||||
import sexpression.BackquoteExpression;
|
||||
import sexpression.Cons;
|
||||
|
@ -20,6 +13,12 @@ import sexpression.SExpression;
|
|||
import sexpression.Symbol;
|
||||
import table.ExecutionContext;
|
||||
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static sexpression.Nil.NIL;
|
||||
import static sexpression.Symbol.T;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
@FunctionNames({ "EVAL" })
|
||||
public class EVAL extends LispFunction {
|
||||
|
||||
|
@ -60,8 +59,8 @@ public class EVAL extends LispFunction {
|
|||
private static LispFunction createLambdaFunction(SExpression lambdaExpression) {
|
||||
if (lambdaExpression.isFunction())
|
||||
return ((LambdaExpression) lambdaExpression).getFunction();
|
||||
else if (isLambdaExpression(lambdaExpression))
|
||||
return createFunction((Cons) lambdaExpression);
|
||||
else if (LAMBDA.Companion.isLambdaExpression(lambdaExpression))
|
||||
return LAMBDA.Companion.createFunction((Cons) lambdaExpression);
|
||||
else
|
||||
throw new UndefinedFunctionException(lambdaExpression);
|
||||
}
|
||||
|
@ -228,5 +227,4 @@ public class EVAL extends LispFunction {
|
|||
return "unmatched at sign";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package function.builtin;
|
||||
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
import environment.RuntimeEnvironment;
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
|
@ -9,6 +7,8 @@ import function.LispFunction;
|
|||
import sexpression.Cons;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
@FunctionNames({ "EXIT" })
|
||||
public class EXIT extends LispFunction {
|
||||
|
||||
|
@ -28,5 +28,4 @@ public class EXIT extends LispFunction {
|
|||
|
||||
return NIL;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
package function.builtin;
|
||||
|
||||
import static function.builtin.APPLY.apply;
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import static function.builtin.APPLY.apply;
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
|
||||
@FunctionNames({ "FUNCALL", "CALL" })
|
||||
public class FUNCALL extends LispFunction {
|
||||
|
||||
|
@ -26,5 +26,4 @@ public class FUNCALL extends LispFunction {
|
|||
|
||||
return apply(applyArgs);
|
||||
}
|
||||
|
||||
}
|
|
@ -32,5 +32,4 @@ public class FUSE extends LispFunction {
|
|||
|
||||
return new Symbol(left.toString() + SEPARATOR + right.toString());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package function.builtin;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
|
@ -9,6 +7,8 @@ import sexpression.Cons;
|
|||
import sexpression.SExpression;
|
||||
import sexpression.Symbol;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
@FunctionNames({ "GENSYM" })
|
||||
public class GENSYM extends LispFunction {
|
||||
|
||||
|
@ -39,5 +39,4 @@ public class GENSYM extends LispFunction {
|
|||
|
||||
return generateSymbol();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,5 @@
|
|||
package function.builtin;
|
||||
|
||||
import static function.builtin.EVAL.eval;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static sexpression.Nil.NIL;
|
||||
import static sexpression.Symbol.T;
|
||||
import static util.Path.getPathPrefix;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Stack;
|
||||
|
||||
import environment.RuntimeEnvironment;
|
||||
import error.LispException;
|
||||
import error.LispWarning;
|
||||
|
@ -21,6 +11,16 @@ import sexpression.Cons;
|
|||
import sexpression.LispString;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Stack;
|
||||
|
||||
import static function.builtin.EVAL.eval;
|
||||
import static java.text.MessageFormat.format;
|
||||
import static sexpression.Nil.NIL;
|
||||
import static sexpression.Symbol.T;
|
||||
import static util.Path.getPathPrefix;
|
||||
|
||||
@FunctionNames({ "LOAD" })
|
||||
public class LOAD extends LispFunction {
|
||||
|
||||
|
@ -114,5 +114,4 @@ public class LOAD extends LispFunction {
|
|||
return format("could not load ''{0}''", fileName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -27,5 +27,4 @@ public class PRINT extends LispFunction {
|
|||
|
||||
return argument;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package function.builtin;
|
||||
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
|
@ -11,6 +9,8 @@ import sexpression.Symbol;
|
|||
import table.ExecutionContext;
|
||||
import table.SymbolTable;
|
||||
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
@FunctionNames({ "SET" })
|
||||
public class SET extends LispFunction {
|
||||
|
||||
|
@ -54,5 +54,4 @@ public class SET extends LispFunction {
|
|||
private boolean isSymbolInTable(SExpression symbol, SymbolTable table) {
|
||||
return table.contains(symbol.toString());
|
||||
}
|
||||
|
||||
}
|
|
@ -25,5 +25,4 @@ public class SYMBOLS extends LispFunction {
|
|||
|
||||
return executionContext.toList();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
package function.builtin;
|
||||
|
||||
import static java.text.MessageFormat.format;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
import error.LispException;
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
|
@ -13,6 +10,9 @@ import sexpression.Cons;
|
|||
import sexpression.SExpression;
|
||||
import sexpression.Symbol;
|
||||
|
||||
import static java.text.MessageFormat.format;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
@FunctionNames({ "SYMBOL-FUNCTION" })
|
||||
public class SYMBOL_FUNCTION extends LispFunction {
|
||||
|
||||
|
@ -60,5 +60,4 @@ public class SYMBOL_FUNCTION extends LispFunction {
|
|||
return format("SYMBOL-FUNCTION: undefined function: {0}", function);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package function.builtin.cons;
|
||||
|
||||
import static sexpression.Nil.NIL;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
|
||||
import static sexpression.Nil.NIL;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
@FunctionNames({ "APPEND" })
|
||||
public class APPEND extends LispFunction {
|
||||
|
|
@ -26,5 +26,4 @@ public class CONS extends LispFunction {
|
|||
|
||||
return new Cons(firstArgument, secondArgument);
|
||||
}
|
||||
|
||||
}
|
|
@ -24,5 +24,4 @@ public class FIRST extends LispFunction {
|
|||
|
||||
return argument.getFirst();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +1,5 @@
|
|||
package function.builtin.cons;
|
||||
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
import static recursion.TailCalls.done;
|
||||
import static recursion.TailCalls.tailCall;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
|
@ -14,6 +7,13 @@ import recursion.TailCall;
|
|||
import sexpression.Cons;
|
||||
import sexpression.LispNumber;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import static function.builtin.cons.LIST.makeList;
|
||||
import static recursion.TailCalls.done;
|
||||
import static recursion.TailCalls.tailCall;
|
||||
import static table.FunctionTable.lookupFunction;
|
||||
|
||||
@FunctionNames({ "LENGTH" })
|
||||
public class LENGTH extends LispFunction {
|
||||
|
||||
|
@ -62,5 +62,4 @@ public class LENGTH extends LispFunction {
|
|||
private BigInteger increment(BigInteger number) {
|
||||
return number.add(BigInteger.ONE);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package function.builtin.cons;
|
||||
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import static sexpression.Nil.NIL;
|
||||
|
||||
@FunctionNames({ "LIST" })
|
||||
public class LIST extends LispFunction {
|
||||
|
||||
|
@ -27,5 +27,4 @@ public class LIST extends LispFunction {
|
|||
|
||||
return argumentList;
|
||||
}
|
||||
|
||||
}
|
|
@ -24,5 +24,4 @@ public class REST extends LispFunction {
|
|||
|
||||
return argument.getRest();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package function.builtin.math;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import error.LispException;
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
|
@ -9,6 +7,8 @@ import function.LispFunction;
|
|||
import sexpression.Cons;
|
||||
import sexpression.LispNumber;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
@FunctionNames({ "/" })
|
||||
public class DIVIDE extends LispFunction {
|
||||
|
||||
|
@ -50,5 +50,4 @@ public class DIVIDE extends LispFunction {
|
|||
return "divide by zero";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package function.builtin.math;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.LispNumber;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
@FunctionNames({ "-" })
|
||||
public class MINUS extends LispFunction {
|
||||
|
||||
|
@ -35,5 +35,4 @@ public class MINUS extends LispFunction {
|
|||
private LispNumber subtract(LispNumber number1, LispNumber number2) {
|
||||
return new LispNumber(number1.getValue().subtract(number2.getValue()));
|
||||
}
|
||||
|
||||
}
|
|
@ -41,5 +41,4 @@ public class MODULO extends LispFunction {
|
|||
return "modulus not positive";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package function.builtin.math;
|
||||
|
||||
import static sexpression.LispNumber.ONE;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.LispNumber;
|
||||
|
||||
import static sexpression.LispNumber.ONE;
|
||||
|
||||
@FunctionNames({ "*" })
|
||||
public class MULTIPLY extends LispFunction {
|
||||
|
||||
|
@ -30,5 +30,4 @@ public class MULTIPLY extends LispFunction {
|
|||
private LispNumber multiply(LispNumber number1, LispNumber number2) {
|
||||
return new LispNumber(number1.getValue().multiply(number2.getValue()));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
package function.builtin.math;
|
||||
|
||||
import static recursion.TailCalls.done;
|
||||
import static recursion.TailCalls.tailCall;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
import recursion.TailCall;
|
||||
import sexpression.Cons;
|
||||
import sexpression.LispNumber;
|
||||
import sexpression.SExpression;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static recursion.TailCalls.done;
|
||||
import static recursion.TailCalls.tailCall;
|
||||
|
||||
class MathFunction {
|
||||
|
||||
Function<LispNumber, LispNumber> singleValueOperation;
|
||||
|
@ -40,5 +40,4 @@ class MathFunction {
|
|||
|
||||
return tailCall(() -> callTailRecursive(new Cons(operationResult, remainingNumbers)));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package function.builtin.math;
|
||||
|
||||
import static sexpression.LispNumber.ZERO;
|
||||
|
||||
import function.ArgumentValidator;
|
||||
import function.FunctionNames;
|
||||
import function.LispFunction;
|
||||
import sexpression.Cons;
|
||||
import sexpression.LispNumber;
|
||||
|
||||
import static sexpression.LispNumber.ZERO;
|
||||
|
||||
@FunctionNames({ "+" })
|
||||
public class PLUS extends LispFunction {
|
||||
|
||||
|
@ -30,5 +30,4 @@ public class PLUS extends LispFunction {
|
|||
private LispNumber add(LispNumber number1, LispNumber number2) {
|
||||
return new LispNumber(number1.getValue().add(number2.getValue()));
|
||||
}
|
||||
|
||||
}
|
|
@ -31,5 +31,4 @@ public class REMAINDER extends LispFunction {
|
|||
throw new DivideByZeroException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue