// Path: app/src/main/java/com/annimon/hotarufx/exceptions/LexerException.java
// public class LexerException extends RuntimeException {
// 
//     public LexerException(String message) {
//         super(message);
//     }
// 
//     public LexerException(SourcePosition position, String message) {
//         super(position.toString() + " " + message);
//     }
// }


import com.annimon.hotarufx.exceptions.LexerException;
import java.util.List;
import org.hamcrest.FeatureMatcher;
import org.hamcrest.Matcher;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.*;
package com.annimon.hotarufx.lexer;


class HotaruLexerTest {

    static List<Token> t(String input) {
        return HotaruLexer.tokenize(input);
    }

    static List<Token> all(String input) {
        return new HotaruLexer(input).tokenize();
    }

    static Token single(String input) {
        List<Token> tokens = t(input);
        if (tokens.isEmpty()) {
            throw new AssertionError("Tokens list is empty");
        }
        return tokens.get(0);
    }

    @Test
    void testTokenizeNumbers() {
        assertThat(all("1 1.5 2"), contains(
                tokenId(HotaruTokenId.NUMBER),
                tokenId(HotaruTokenId.WS),
                tokenId(HotaruTokenId.NUMBER),
                tokenId(HotaruTokenId.WS),
                tokenId(HotaruTokenId.NUMBER)
        ));

// Path: app/src/main/java/com/annimon/hotarufx/exceptions/LexerException.java
// public class LexerException extends RuntimeException {
// 
//     public LexerException(String message) {
//         super(message);
//     }
// 
//     public LexerException(SourcePosition position, String message) {
//         super(position.toString() + " " + message);
//     }
// }


// Path: app/src/test/java/com/annimon/hotarufx/lexer/HotaruLexerTest.java
import com.annimon.hotarufx.exceptions.LexerException;
import java.util.List;
import org.hamcrest.FeatureMatcher;
import org.hamcrest.Matcher;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.*;

package com.annimon.hotarufx.lexer;


class HotaruLexerTest {

    static List<Token> t(String input) {
        return HotaruLexer.tokenize(input);
    }

    static List<Token> all(String input) {
        return new HotaruLexer(input).tokenize();
    }

    static Token single(String input) {
        List<Token> tokens = t(input);
        if (tokens.isEmpty()) {
            throw new AssertionError("Tokens list is empty");
        }
        return tokens.get(0);
    }

    @Test
    void testTokenizeNumbers() {
        assertThat(all("1 1.5 2"), contains(
                tokenId(HotaruTokenId.NUMBER),
                tokenId(HotaruTokenId.WS),
                tokenId(HotaruTokenId.NUMBER),
                tokenId(HotaruTokenId.WS),
                tokenId(HotaruTokenId.NUMBER)
        ));

        assertThrows(LexerException.class, () -> {