Examples of BjorneToken


Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand11() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "A");
        List<BjorneToken> expansion = context.expandAndSplit(new BjorneToken("\\$A"));
        checkExpansion(expansion, new String[] {"$A"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand12() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "A");
        List<BjorneToken> expansion = context.expandAndSplit(new BjorneToken("\"$A\""));
        checkExpansion(expansion, new String[] {"A"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand13() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "A");
        List<BjorneToken> expansion = context.expandAndSplit(new BjorneToken("'$A'"));
        checkExpansion(expansion, new String[] {"$A"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand14() throws ShellException {
        TestBjorneContext parentContext = new TestBjorneContext(new CommandIOHolder[0]);
        parentContext.setVariable("A", "A");
        BjorneContext context = new BjorneContext(parentContext);
        List<BjorneToken> expansion = context.expandAndSplit(new BjorneToken("'$A'"));
        checkExpansion(expansion, new String[] {"$A"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

        PathnamePattern.clearCache();
        BjorneContext context = new TestBjorneContext();
        Assert.assertEquals(true, context.isGlobbing());
        Assert.assertEquals(true, context.isTildeExpansion());
        if (new File("../README.txt").exists()) {
            CommandLine expansion = context.buildCommandLine(new BjorneToken("../README.*"));
            checkExpansion(expansion, new String[] {"../README.txt"});
            expansion = context.buildCommandLine(new BjorneToken("../README.\\*"));
            checkExpansion(expansion, new String[] {"../README.*"});
            expansion = context.buildCommandLine(new BjorneToken("\"../README.*\""));
            checkExpansion(expansion, new String[] {"../README.*"});
            expansion = context.buildCommandLine(new BjorneToken("\'../README.*\'"));
            checkExpansion(expansion, new String[] {"../README.*"});

            context.setGlobbing(false);
            expansion = context.buildCommandLine(new BjorneToken("../README.*"));
            checkExpansion(expansion, new String[] {"../README.*"});
        } else {
            System.err.println("skipping 'glob' tests ... no ../README.txt");
        }

View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand16() throws Exception {
        BjorneContext context = new TestBjorneContext();
        Assert.assertEquals(true, context.isGlobbing());
        Assert.assertEquals(true, context.isTildeExpansion());
        CommandLine expansion = context.buildCommandLine(new BjorneToken("~"));
        checkExpansion(expansion, new String[] {System.getProperty("user.home")});
        context.setTildeExpansion(false);
        expansion = context.buildCommandLine(new BjorneToken("~"));
        checkExpansion(expansion, new String[] {"~"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand17() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "A");
        List<BjorneToken> expansion = context.expandAndSplit(new BjorneToken("${A}"));
        checkExpansion(expansion, new String[] {"A"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    @Test
    public void testExpand18() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "A");
        context.setVariable("B", "");
        List<BjorneToken> expansion = context.expandAndSplit(new BjorneToken("${#A} ${#B} ${#C}"));
        checkExpansion(expansion, new String[] {"1", "0", "0"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    public void testExpand19() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "A");
        context.setVariable("B", "");
        List<BjorneToken> expansion =
                context.expandAndSplit(new BjorneToken("${A:-X} ${B:-Y} ${C:-Z}"));
        checkExpansion(expansion, new String[] {"A", "Y", "Z"});
    }
View Full Code Here

Examples of org.jnode.shell.bjorne.BjorneToken

    public void testExpand20() throws ShellException {
        TestBjorneContext context = new TestBjorneContext();
        context.setVariable("A", "");
        context.setVariable("B", "B");
        List<BjorneToken> expansion =
                context.expandAndSplit(new BjorneToken(
                        "${A:-$B} ${A:-${B}} ${A:-${A:-$B}} ${A:-'${B}'}"));
        checkExpansion(expansion, new String[] {"B", "B", "B", "${B}"});
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.