Q:

double or triple rule to the right-justified chapter heading

For each chapter I am trying to put a double or triple horizontal rule that starts on the left and continues to the right-justified chapter heading like this:
================================================================= Chapter 10
I think I have a partial solution to creating the rule but when I put the code before \chaptertitlename \thechapter the word Chapter disappears and the chapter number shifts to the next line.
Here's what I've got:
\documentclass{book}
\usepackage[margin=1in]{geometry}
\usepackage{titlesec}

\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries\raggedright\sffamily}{\raggedleft\chaptertitlename\ \thechapter}{20pt} 
{\Huge}

\newcommand{\chapterrule}{0.4pt}      % chapter rule thickness
\newcommand{\chapterrulesep}{5pt}     % space between the rules
\newcommand{\chapterruleoffset}{2pt}  % distance of the bottom rule from the baseline

\newcommand{\triplerule}[1]{%
\vbox{
\sbox0{ #1 }%
\dimen0=\textwidth
\advance\dimen0 by -\wd0
\noindent
\maketriplerule
\usebox{0}%
   }
}

\newcommand{\maketriplerule}{%
\vbox{
\hrule width \dimen0 height \chapterrule
\vskip\chapterrulesep
\hrule height \chapterrule
\vskip\chapterrulesep
\hrule height \dimen0 height \chapterrule
\vskip\chapterruleoffset
  }%
}

\begin{document}

\chapter[Test]{Test}

This is a test sentence.

\end{document}

A:

Not sure this is exactly what you want, but I defined, adapted from a code by @DavidCarlisle, a \triplerulefill command:
    \documentclass{book}
    \usepackage[margin=1in]{geometry}
    \usepackage{titlesec}
\newcommand\triplerulefill{\leavevmode\leaders\vbox{\hrule width.1pt\kern 5pt\hrule width .1pt\kern 5pt\hrule\kern 3pt}\hfill\kern0pt }

\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries\raggedright\sffamily}{ \triplerulefill\,\chaptertitlename\ \thechapter}{20pt}
{\Huge}

\begin{document}

\chapter[Test]{Test}

 This is a test sentence in a Test chapter.

\end{document}

